Home » openjdk-7 » java » io » [javadoc | source]
java.io
class: ObjectInputStream.BlockDataInputStream [javadoc | source]
java.lang.Object
   java.io.InputStream
      java.io.ObjectInputStream$BlockDataInputStream

All Implemented Interfaces:
    DataInput, Closeable

Input stream with two modes: in default mode, inputs data written in the same format as DataOutputStream; in "block data" mode, inputs data bracketed by block data markers (see object serialization specification for details). Buffering depends on block data mode: when in default mode, no data is buffered in advance; when in block data mode, all data for the current data block is read in at once (and buffered).
Constructor:
 BlockDataInputStream(InputStream in) 
    Creates new BlockDataInputStream on top of given underlying stream. Block data mode is turned off by default.
Method from java.io.ObjectInputStream$BlockDataInputStream Summary:
available,   close,   currentBlockRemaining,   getBlockDataMode,   peek,   peekByte,   read,   read,   read,   readBoolean,   readBooleans,   readByte,   readChar,   readChars,   readDouble,   readDoubles,   readFloat,   readFloats,   readFully,   readFully,   readFully,   readInt,   readInts,   readLine,   readLong,   readLongUTF,   readLongs,   readShort,   readShorts,   readUTF,   readUnsignedByte,   readUnsignedShort,   setBlockDataMode,   skip,   skipBlockData,   skipBytes
Methods from java.io.InputStream:
available,   close,   mark,   markSupported,   read,   read,   read,   reset,   skip
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.io.ObjectInputStream$BlockDataInputStream Detail:
 public int available() throws IOException 
 public  void close() throws IOException 
 int currentBlockRemaining() 
    If in block data mode, returns the number of unconsumed bytes remaining in the current data block. If not in block data mode, throws an IllegalStateException.
 boolean getBlockDataMode() 
    Returns true if the stream is currently in block data mode, false otherwise.
 int peek() throws IOException 
    Peeks at (but does not consume) and returns the next byte value in the stream, or -1 if the end of the stream/block data (if in block data mode) has been reached.
 byte peekByte() throws IOException 
    Peeks at (but does not consume) and returns the next byte value in the stream, or throws EOFException if end of stream/block data has been reached.
 public int read() throws IOException 
 public int read(byte[] b,
    int off,
    int len) throws IOException 
 int read(byte[] b,
    int off,
    int len,
    boolean copy) throws IOException 
    Attempts to read len bytes into byte array b at offset off. Returns the number of bytes read, or -1 if the end of stream/block data has been reached. If copy is true, reads values into an intermediate buffer before copying them to b (to avoid exposing a reference to b).
 public boolean readBoolean() throws IOException 
  void readBooleans(boolean[] v,
    int off,
    int len) throws IOException 
 public byte readByte() throws IOException 
 public char readChar() throws IOException 
  void readChars(char[] v,
    int off,
    int len) throws IOException 
 public double readDouble() throws IOException 
  void readDoubles(double[] v,
    int off,
    int len) throws IOException 
 public float readFloat() throws IOException 
  void readFloats(float[] v,
    int off,
    int len) throws IOException 
 public  void readFully(byte[] b) throws IOException 
 public  void readFully(byte[] b,
    int off,
    int len) throws IOException 
 public  void readFully(byte[] b,
    int off,
    int len,
    boolean copy) throws IOException 
 public int readInt() throws IOException 
  void readInts(int[] v,
    int off,
    int len) throws IOException 
 public String readLine() throws IOException 
 public long readLong() throws IOException 
 String readLongUTF() throws IOException 
    Reads in string written in "long" UTF format. "Long" UTF format is identical to standard UTF, except that it uses an 8 byte header (instead of the standard 2 bytes) to convey the UTF encoding length.
  void readLongs(long[] v,
    int off,
    int len) throws IOException 
 public short readShort() throws IOException 
  void readShorts(short[] v,
    int off,
    int len) throws IOException 
 public String readUTF() throws IOException 
 public int readUnsignedByte() throws IOException 
 public int readUnsignedShort() throws IOException 
 boolean setBlockDataMode(boolean newmode) throws IOException 
    Sets block data mode to the given mode (true == on, false == off) and returns the previous mode value. If the new mode is the same as the old mode, no action is taken. Throws IllegalStateException if block data mode is being switched from on to off while unconsumed block data is still present in the stream.
 public long skip(long len) throws IOException 
  void skipBlockData() throws IOException 
    If in block data mode, skips to the end of the current group of data blocks (but does not unset block data mode). If not in block data mode, throws an IllegalStateException.
 public int skipBytes(int n) throws IOException