DataInput and DataOutput

DataInput and DataOutput read and write primitive Java types from a stream. Since they're interfaces, all of their methods, which follow, are abstract and so do nothing until they're instantiated.

DataInput:

  • readBoolean()

  • readByte()

  • readFloat()

  • readChar()

  • readDouble()

  • readInt()

  • readShort()

  • readLong()

  • readLine()

  • readUTF()

  • readUnsignedByte()

  • readUnsignedShort()

  • readFully(byte_sequence)

  • readFully(byte_sequence, off, len)

  • skipBytes(n)

DataOutput:

  • write (b)

  • write(byte_sequence)

  • writeBoolean(boolean)

  • writeByte(byte)

  • writeBytes(string)

  • writeChar(char)

  • writeChars(string)

  • writeDouble(double)

  • writeFloat(float)

  • writeInt(int)

  • writeLong(long)

  • writeShort(short)

  • writeUTF()

DataInputStream and DataOutput Stream

The data stream classes, DataInputStream and DataOutputStream ...

Get Python Programming with the Java™ Class Libraries: A Tutorial for Building Web and Enterprise Applications with Jython now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.