com.badlogic.gdx.utils
Class DataOutput

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by java.io.DataOutputStream
              extended by com.badlogic.gdx.utils.DataOutput
All Implemented Interfaces:
Closeable, DataOutput, Flushable

public class DataOutput
extends DataOutputStream

Extends DataOutputStream with additional convenience methods.

Author:
Nathan Sweet

Constructor Summary
DataOutput(OutputStream out)
           
 
Method Summary
 int writeInt(int value, boolean optimizePositive)
          Writes a 1-5 byte int.
 void writeString(String value)
          Writes a length and then the string as UTF8.
 
Methods inherited from class java.io.DataOutputStream
flush, size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
 
Methods inherited from class java.io.FilterOutputStream
close, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.io.DataOutput
write
 

Constructor Detail

DataOutput

public DataOutput(OutputStream out)
Method Detail

writeInt

public int writeInt(int value,
                    boolean optimizePositive)
             throws IOException
Writes a 1-5 byte int.

Parameters:
optimizePositive - If true, small positive numbers will be more efficient (1 byte) and small negative numbers will be inefficient (5 bytes).
Throws:
IOException

writeString

public void writeString(String value)
                 throws IOException
Writes a length and then the string as UTF8.

Parameters:
value - May be null.
Throws:
IOException


Copyright © 2013. All Rights Reserved.