Top Description Inners Methods
com.fasterxml.jackson.core.format

public Interface InputAccessor

Known Direct Implementers
com.fasterxml.jackson.core.format.InputAccessor.Std
Imports
java.io.*, com.fasterxml.jackson.core.JsonFactory

Interface used to expose beginning of a data file to data format detection code.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
InputAccessor.Std

Basic implementation that reads data from given InputStream and buffers it as necessary.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

Whether there is at least one more input byte accessible
hasMoreBytes
()

Method to call to check if more input is available.

public byte

Returns:

Next content byte, if available
nextByte
()

Returns next byte available, if any; if no more bytes are available, will throw java.io.EOFException.

public void
reset()

Method that can be called to reset accessor to read from beginning of input.

Method Detail

hasMoreBytesback to summary
public boolean hasMoreBytes() throws IOException

Method to call to check if more input is available. Since this may result in more content to be read (at least one more byte), a IOException may get thrown.

Returns:boolean

Whether there is at least one more input byte accessible

Exceptions
IOException:
If check for more content failed due to issue with underlying input abstraction
nextByteback to summary
public byte nextByte() throws IOException

Returns next byte available, if any; if no more bytes are available, will throw java.io.EOFException.

Returns:byte

Next content byte, if available

Exceptions
IOException:
If called and there is no more content available
resetback to summary
public void reset()

Method that can be called to reset accessor to read from beginning of input.

com.fasterxml.jackson.core.format back to summary

public Class InputAccessor.Std

extends Object
implements InputAccessor
Class Inheritance
All Implemented Interfaces
com.fasterxml.jackson.core.format.InputAccessor

Basic implementation that reads data from given InputStream and buffers it as necessary.

Field Summary

Modifier and TypeField and Description
protected final byte[]
protected int
_bufferedEnd

End of valid bytes in the buffer (points to one past last valid)

protected final int
protected final InputStream
protected int
_ptr

Pointer to next available buffered byte in _buffer.

Constructor Summary

AccessConstructor and Description
public
Std(InputStream in, byte[] buffer)

public
Std(byte[] inputDocument)

public
Std(byte[] inputDocument, int start, int len)

Method Summary

Modifier and TypeMethod and Description
public DataFormatMatcher
createMatcher(JsonFactory match, MatchStrength matchStrength)

public boolean
hasMoreBytes()

Implements com.fasterxml.jackson.core.format.InputAccessor.hasMoreBytes.

Method to call to check if more input is available.
public byte
nextByte()

Implements com.fasterxml.jackson.core.format.InputAccessor.nextByte.

Returns next byte available, if any; if no more bytes are available, will throw java.io.EOFException.
public void
reset()

Implements com.fasterxml.jackson.core.format.InputAccessor.reset.

Method that can be called to reset accessor to read from beginning of input.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_bufferback to summary
protected final byte[] _buffer
_bufferedEndback to summary
protected int _bufferedEnd

End of valid bytes in the buffer (points to one past last valid)

_bufferedStartback to summary
protected final int _bufferedStart
_inback to summary
protected final InputStream _in
_ptrback to summary
protected int _ptr

Pointer to next available buffered byte in _buffer.

Constructor Detail

Stdback to summary
public Std(InputStream in, byte[] buffer)
Stdback to summary
public Std(byte[] inputDocument)
Stdback to summary
public Std(byte[] inputDocument, int start, int len)

Method Detail

createMatcherback to summary
public DataFormatMatcher createMatcher(JsonFactory match, MatchStrength matchStrength)
hasMoreBytesback to summary
public boolean hasMoreBytes() throws IOException

Implements com.fasterxml.jackson.core.format.InputAccessor.hasMoreBytes.

Doc from com.fasterxml.jackson.core.format.InputAccessor.hasMoreBytes.

Method to call to check if more input is available. Since this may result in more content to be read (at least one more byte), a IOException may get thrown.

Returns:boolean

Whether there is at least one more input byte accessible

Annotations
@Override
Exceptions
IOException:
If check for more content failed due to issue with underlying input abstraction
nextByteback to summary
public byte nextByte() throws IOException

Implements com.fasterxml.jackson.core.format.InputAccessor.nextByte.

Doc from com.fasterxml.jackson.core.format.InputAccessor.nextByte.

Returns next byte available, if any; if no more bytes are available, will throw java.io.EOFException.

Returns:byte

Next content byte, if available

Annotations
@Override
Exceptions
IOException:
If called and there is no more content available
resetback to summary
public void reset()

Implements com.fasterxml.jackson.core.format.InputAccessor.reset.

Doc from com.fasterxml.jackson.core.format.InputAccessor.reset.

Method that can be called to reset accessor to read from beginning of input.

Annotations
@Override