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, writeUTF
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
write
public void write(byte[] buffer, int offset, int count)
AbstractDataOutput
count
bytes from the byte array buffer
starting at offset
to this RandomAccessFile starting at
the current file pointer..write
in interface java.io.DataOutput
write
in class AbstractDataOutput
buffer
- the bytes to be writtenoffset
- offset in buffer to get bytescount
- number of bytes in buffer to writepublic void write(int oneByte)
AbstractDataOutput
oneByte
to this RandomAccessFile
starting at the current file pointer. Only the low order byte of
oneByte
is written.write
in interface java.io.DataOutput
write
in class AbstractDataOutput
oneByte
- the byte to be writtenpublic void writeShort(int val) throws java.io.IOException
AbstractDataOutput
writeShort
in interface java.io.DataOutput
writeShort
in class AbstractDataOutput
val
- the short to be writtenjava.io.IOException
- If an error occurs attempting to write to this
DataOutputStream.public void writeInt(int val)
AbstractDataOutput
writeInt
in interface java.io.DataOutput
writeInt
in class AbstractDataOutput
val
- the int to be written.public void writeLong(long val)
AbstractDataOutput
writeLong
in interface java.io.DataOutput
writeLong
in class AbstractDataOutput
val
- the long to be written.public void write(java.nio.ByteBuffer buffer)
write
in interface DataOutputPlus
write
in class AbstractDataOutput
public void write(Memory memory)
public SafeMemory currentBuffer()
public void setCapacity(long newCapacity)
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
public long length()
public long capacity()
public SafeMemoryWriter withByteOrder(java.nio.ByteOrder order)
Copyright © 2016 The Apache Software Foundation