public class SafeMemoryWriter extends AbstractDataOutput implements DataOutputPlus
| Constructor and Description |
|---|
SafeMemoryWriter(long initialCapacity) |
| Modifier and Type | Method and Description |
|---|---|
long |
capacity() |
void |
close() |
SafeMemory |
currentBuffer() |
long |
length() |
void |
setCapacity(long newCapacity) |
SafeMemoryWriter |
withByteOrder(java.nio.ByteOrder order) |
void |
write(byte[] buffer,
int offset,
int count)
Writes
count bytes from the byte array buffer
starting at offset to this RandomAccessFile starting at
the current file pointer.. |
void |
write(java.nio.ByteBuffer buffer) |
void |
write(int oneByte)
Writes the specified byte
oneByte to this RandomAccessFile
starting at the current file pointer. |
void |
write(Memory memory) |
void |
writeInt(int val)
Writes a 32-bit int to this output stream.
|
void |
writeLong(long val)
Writes a 64-bit long to this output stream.
|
void |
writeShort(int val)
Writes the specified 16-bit short to the OutputStream.
|
write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeUTFclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwritepublic void write(byte[] buffer,
int offset,
int count)
AbstractDataOutputcount bytes from the byte array buffer
starting at offset to this RandomAccessFile starting at
the current file pointer..write in interface java.io.DataOutputwrite in class AbstractDataOutputbuffer - the bytes to be writtenoffset - offset in buffer to get bytescount - number of bytes in buffer to writepublic void write(int oneByte)
AbstractDataOutputoneByte to this RandomAccessFile
starting at the current file pointer. Only the low order byte of
oneByte is written.write in interface java.io.DataOutputwrite in class AbstractDataOutputoneByte - the byte to be writtenpublic void writeShort(int val)
throws java.io.IOException
AbstractDataOutputwriteShort in interface java.io.DataOutputwriteShort in class AbstractDataOutputval - the short to be writtenjava.io.IOException - If an error occurs attempting to write to this
DataOutputStream.public void writeInt(int val)
AbstractDataOutputwriteInt in interface java.io.DataOutputwriteInt in class AbstractDataOutputval - the int to be written.public void writeLong(long val)
AbstractDataOutputwriteLong in interface java.io.DataOutputwriteLong in class AbstractDataOutputval - the long to be written.public void write(java.nio.ByteBuffer buffer)
write in interface DataOutputPluswrite in class AbstractDataOutputpublic void write(Memory memory)
public SafeMemory currentBuffer()
public void setCapacity(long newCapacity)
public void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreampublic long length()
public long capacity()
public SafeMemoryWriter withByteOrder(java.nio.ByteOrder order)
Copyright © 2015 The Apache Software Foundation