javadoc.com.google.common.io.LittleEndianDataOutputStream.html Maven / Gradle / Ivy
The newest version!
LittleEndianDataOutputStream (Guava: Google Core Libraries for Java 11.0.1 API)
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
com.google.common.io
Class LittleEndianDataOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
com.google.common.io.LittleEndianDataOutputStream
- All Implemented Interfaces:
- Closeable, DataOutput, Flushable
@Beta
public class LittleEndianDataOutputStream
- extends FilterOutputStream
- implements DataOutput
An implementation of DataOutput
that uses little-endian byte ordering
for writing char
, short
, int
, float
, double
, and long
values.
Note: This class intentionally violates the specification of its
supertype DataOutput
, which explicitly requires big-endian byte
order.
- Since:
- 8.0
- Author:
- Chris Nokleberg, Keith Bottner
Field Summary |
---|
Fields inherited from class java.io.FilterOutputStream |
---|
out |
Constructor Summary | |
---|---|
LittleEndianDataOutputStream(OutputStream out)
Creates a LittleEndianDataOutputStream that wraps the given stream. |
Method Summary | |
---|---|
void |
write(byte[] b,
int off,
int len)
|
void |
writeBoolean(boolean v)
|
void |
writeByte(int v)
|
void |
writeBytes(String s)
Deprecated. The semantics of writeBytes(String s) are considered
dangerous. Please use writeUTF(String s) ,
writeChars(String s) or another write method instead. |
void |
writeChar(int v)
Writes a char as specified by DataOutputStream.writeChar(int) ,
except using little-endian byte order. |
void |
writeChars(String s)
Writes a String as specified by
DataOutputStream.writeChars(String) , except each character is
written using little-endian byte order. |
void |
writeDouble(double v)
Writes a double as specified by
DataOutputStream.writeDouble(double) , except using little-endian
byte order. |
void |
writeFloat(float v)
Writes a float as specified by
DataOutputStream.writeFloat(float) , except using little-endian byte
order. |
void |
writeInt(int v)
Writes an int as specified by
DataOutputStream.writeInt(int) , except using little-endian byte
order. |
void |
writeLong(long v)
Writes a long as specified by
DataOutputStream.writeLong(long) , except using little-endian byte
order. |
void |
writeShort(int v)
Writes a short as specified by
DataOutputStream.writeShort(int) , except using little-endian byte
order. |
void |
writeUTF(String str)
|
Methods inherited from class java.io.FilterOutputStream |
---|
close, flush, write, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.io.DataOutput |
---|
write, write |
Constructor Detail |
---|
LittleEndianDataOutputStream
public LittleEndianDataOutputStream(OutputStream out)
- Creates a
LittleEndianDataOutputStream
that wraps the given stream.- Parameters:
out
- the stream to delegate to
Method Detail |
---|
write
public void write(byte[] b, int off, int len) throws IOException
- Specified by:
write
in interfaceDataOutput
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
writeBoolean
public void writeBoolean(boolean v) throws IOException
- Specified by:
writeBoolean
in interfaceDataOutput
- Throws:
IOException
writeByte
public void writeByte(int v) throws IOException
- Specified by:
writeByte
in interfaceDataOutput
- Throws:
IOException
writeBytes
@Deprecated public void writeBytes(String s) throws IOException
- Deprecated. The semantics of
writeBytes(String s)
are considered dangerous. Please usewriteUTF(String s)
,writeChars(String s)
or another write method instead.- Specified by:
writeBytes
in interfaceDataOutput
- Throws:
IOException
writeChar
public void writeChar(int v) throws IOException
- Writes a char as specified by
DataOutputStream.writeChar(int)
, except using little-endian byte order.- Specified by:
writeChar
in interfaceDataOutput
- Throws:
IOException
- if an I/O error occurs
writeChars
public void writeChars(String s) throws IOException
- Writes a
String
as specified byDataOutputStream.writeChars(String)
, except each character is written using little-endian byte order.- Specified by:
writeChars
in interfaceDataOutput
- Throws:
IOException
- if an I/O error occurs
writeDouble
public void writeDouble(double v) throws IOException
- Writes a
double
as specified byDataOutputStream.writeDouble(double)
, except using little-endian byte order.- Specified by:
writeDouble
in interfaceDataOutput
- Throws:
IOException
- if an I/O error occurs
writeFloat
public void writeFloat(float v) throws IOException
- Writes a
float
as specified byDataOutputStream.writeFloat(float)
, except using little-endian byte order.- Specified by:
writeFloat
in interfaceDataOutput
- Throws:
IOException
- if an I/O error occurs
writeInt
public void writeInt(int v) throws IOException
- Writes an
int
as specified byDataOutputStream.writeInt(int)
, except using little-endian byte order.- Specified by:
writeInt
in interfaceDataOutput
- Throws:
IOException
- if an I/O error occurs
writeLong
public void writeLong(long v) throws IOException
- Writes a
long
as specified byDataOutputStream.writeLong(long)
, except using little-endian byte order.- Specified by:
writeLong
in interfaceDataOutput
- Throws:
IOException
- if an I/O error occurs
writeShort
public void writeShort(int v) throws IOException
- Writes a
short
as specified byDataOutputStream.writeShort(int)
, except using little-endian byte order.- Specified by:
writeShort
in interfaceDataOutput
- Throws:
IOException
- if an I/O error occurs
writeUTF
public void writeUTF(String str) throws IOException
- Specified by:
writeUTF
in interfaceDataOutput
- Throws:
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2010-2012. All Rights Reserved.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy