Package nom.tam.util
Class BufferedFile
- java.lang.Object
-
- nom.tam.util.BufferedFile
-
- All Implemented Interfaces:
java.io.Closeable,java.io.DataInput,java.io.DataOutput,java.lang.AutoCloseable,ArrayDataInput,ArrayDataOutput,FitsIO,RandomAccess
public class BufferedFile extends java.lang.Object implements ArrayDataOutput, RandomAccess
-
-
Field Summary
Fields Modifier and Type Field Description private intbufferMarkermarker position in the dataBuffer.buffer.private BufferPointerbufferPointerprivate BufferDecoderdataDecoderprivate BufferEncoderdataEncoderprivate static intDEFAULT_BUFFER_SIZEprivate booleandoingInputIs the dataBuffer.buffer being used for input or outputprivate longfileOffsetThe offset of the beginning of the current dataBuffer.bufferprivate static java.util.logging.LoggerLOGprivate java.io.RandomAccessFilerandomAccessFileThe underlying access to the file system-
Fields inherited from interface nom.tam.util.FitsIO
BITS_OF_1_BYTE, BITS_OF_2_BYTES, BITS_OF_3_BYTES, BITS_OF_4_BYTES, BITS_OF_5_BYTES, BITS_OF_6_BYTES, BITS_OF_7_BYTES, BYTE_1_OF_LONG_MASK, BYTE_2_OF_LONG_MASK, BYTE_3_OF_LONG_MASK, BYTE_4_OF_LONG_MASK, BYTE_MASK, BYTES_IN_BOOLEAN, BYTES_IN_BYTE, BYTES_IN_CHAR, BYTES_IN_DOUBLE, BYTES_IN_FLOAT, BYTES_IN_INTEGER, BYTES_IN_LONG, BYTES_IN_SHORT, HIGH_INTEGER_MASK, INTEGER_MASK, SHORT_MASK, SHORT_OF_LONG_MASK
-
-
Constructor Summary
Constructors Constructor Description BufferedFile(java.io.File file)Create a buffered file from a File descriptorBufferedFile(java.io.File file, java.lang.String mode)Create a buffered file from a File descriptorBufferedFile(java.io.File file, java.lang.String mode, int bufferSize)Create a buffered file from a file descriptorBufferedFile(java.lang.String filename)Create a read-only buffered fileBufferedFile(java.lang.String filename, java.lang.String mode)Create a buffered file with the given mode.BufferedFile(java.lang.String filename, java.lang.String mode, int bufferSize)Create a buffered file with the given mode and a specified dataBuffer.buffer size.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private voidcheckBuffer(int needBytes)This should only be used when a small number of bytes is required (substantially smaller than bufferSize.voidclose()protected voidfinalize()voidflush()Flush the output bufferjava.nio.channels.FileChannelgetChannel()Get the channel associated with this file.java.io.FileDescriptorgetFD()Get the file descriptor associated with this stream.longgetFilePointer()Get the current offset into the file.longlength()voidmark(int readlimit)See the general contract of themarkmethod ofInputStream.private voidneedBuffer(int need)intread()intread(boolean[] b)Read an array of boolean's.intread(boolean[] b, int start, int length)Read a segment of an array of boolean's.intread(byte[] buf)Read an array of byte's.intread(byte[] buf, int offset, int len)Read a segment of an array of byte's.intread(char[] c)Read an array of char's.intread(char[] c, int start, int length)Read a segment of an array of char's.intread(double[] d)Read an array of double's.intread(double[] d, int start, int length)Read a segment of an array of double's.intread(float[] f)Read an array of float's.intread(float[] f, int start, int length)Read a segment of an array of float's.intread(int[] i)Read an array of int's.intread(int[] i, int start, int length)Read a segment of an array of int's.intread(long[] l)Read a segment of an array of long's.intread(long[] l, int start, int length)Read a segment of an array of long's.intread(short[] s)Read an array of short's.intread(short[] s, int start, int length)Read a segment of an array of short's.intreadArray(java.lang.Object o)Deprecated.booleanreadBoolean()bytereadByte()charreadChar()doublereadDouble()floatreadFloat()voidreadFully(byte[] b)voidreadFully(byte[] b, int off, int len)Read a buffer and signal an EOF if the requested elements cannot be read.intreadInt()longreadLArray(java.lang.Object o)Read an object.java.lang.StringreadLine()Read a line of input.longreadLong()shortreadShort()intreadUnsignedByte()intreadUnsignedShort()java.lang.StringreadUTF()voidreset()See the general contract of theresetmethod ofInputStream.voidseek(long offsetFromStart)Move to a specified location in the stream.voidsetLength(long newLength)Set the length of the file.longskip(long offset)Skip the number of bytes.voidskipAllBytes(int toSkip)Skip the number of bytes.voidskipAllBytes(long toSkip)Skip the number of bytes.intskipBytes(int n)voidwrite(boolean[] b)Write an array of boolean's.voidwrite(boolean[] b, int start, int length)Write a segment of an array of boolean's.voidwrite(byte[] buf)voidwrite(byte[] buf, int offset, int length)voidwrite(char[] c)Write an array of char's.voidwrite(char[] c, int start, int length)Write a segment of an array of char's.voidwrite(double[] d)Write an array of double's.voidwrite(double[] d, int start, int length)Write a segment of an array of double's.voidwrite(float[] f)Write an array of float's.voidwrite(float[] f, int start, int length)Write a segment of an array of float's.voidwrite(int buf)voidwrite(int[] i)Write an array of int's.voidwrite(int[] i, int start, int length)Write a segment of an array of int's.voidwrite(long[] l)Write an array of longs.voidwrite(long[] l, int start, int length)Write a segment of an array of longs.voidwrite(short[] s)Write an array of shorts.voidwrite(short[] s, int start, int length)Write a segment of an array of shorts.voidwrite(java.lang.String[] s)Write an array of Strings.voidwrite(java.lang.String[] s, int start, int length)Write a segment of an array of Strings.voidwriteArray(java.lang.Object o)This routine provides efficient writing of arrays of any primitive type.voidwriteBoolean(boolean b)voidwriteByte(int b)voidwriteBytes(java.lang.String s)voidwriteChar(int c)voidwriteChars(java.lang.String s)voidwriteDouble(double d)voidwriteFloat(float f)voidwriteInt(int i)voidwriteLong(long l)voidwriteShort(int s)voidwriteUTF(java.lang.String s)
-
-
-
Field Detail
-
DEFAULT_BUFFER_SIZE
private static final int DEFAULT_BUFFER_SIZE
- See Also:
- Constant Field Values
-
LOG
private static final java.util.logging.Logger LOG
-
bufferPointer
private final BufferPointer bufferPointer
-
dataDecoder
private final BufferDecoder dataDecoder
-
dataEncoder
private final BufferEncoder dataEncoder
-
randomAccessFile
private final java.io.RandomAccessFile randomAccessFile
The underlying access to the file system
-
fileOffset
private long fileOffset
The offset of the beginning of the current dataBuffer.buffer
-
doingInput
private boolean doingInput
Is the dataBuffer.buffer being used for input or output
-
bufferMarker
private int bufferMarker
marker position in the dataBuffer.buffer.
-
-
Constructor Detail
-
BufferedFile
public BufferedFile(java.io.File file) throws java.io.IOExceptionCreate a buffered file from a File descriptor- Parameters:
file- the file to open.- Throws:
java.io.IOException- if the file could not be opened
-
BufferedFile
public BufferedFile(java.io.File file, java.lang.String mode) throws java.io.IOExceptionCreate a buffered file from a File descriptor- Parameters:
file- the file to open.mode- the mode to open the file in- Throws:
java.io.IOException- if the file could not be opened
-
BufferedFile
public BufferedFile(java.io.File file, java.lang.String mode, int bufferSize) throws java.io.IOExceptionCreate a buffered file from a file descriptor- Parameters:
file- the file to open.mode- the mode to open the file inbufferSize- the dataBuffer.buffer size to use- Throws:
java.io.IOException- if the file could not be opened
-
BufferedFile
public BufferedFile(java.lang.String filename) throws java.io.IOExceptionCreate a read-only buffered file- Parameters:
filename- the name of the file to open- Throws:
java.io.IOException- if the file could not be opened
-
BufferedFile
public BufferedFile(java.lang.String filename, java.lang.String mode) throws java.io.IOExceptionCreate a buffered file with the given mode.- Parameters:
filename- The file to be accessed.mode- A string composed of "r" and "w" for read and write access.- Throws:
java.io.IOException- if the file could not be opened
-
BufferedFile
public BufferedFile(java.lang.String filename, java.lang.String mode, int bufferSize) throws java.io.IOExceptionCreate a buffered file with the given mode and a specified dataBuffer.buffer size.- Parameters:
filename- The file to be accessed.mode- A string composed of "r" and "w" indicating read or write access.bufferSize- The dataBuffer.buffer size to be used. This should be substantially larger than 100 bytes and defaults to 32768 bytes in the other constructors.- Throws:
java.io.IOException- if the file could not be opened
-
-
Method Detail
-
checkBuffer
private void checkBuffer(int needBytes) throws java.io.IOExceptionThis should only be used when a small number of bytes is required (substantially smaller than bufferSize.- Parameters:
needBytes- the number of bytes needed for the next read operation.- Throws:
java.io.IOException- if the dataBuffer.buffer could not be filled
-
close
public void close() throws java.io.IOException
-
finalize
protected void finalize()
- Overrides:
finalizein classjava.lang.Object
-
flush
public void flush() throws java.io.IOExceptionDescription copied from interface:ArrayDataOutputFlush the output buffer- Specified by:
flushin interfaceArrayDataOutput- Throws:
java.io.IOException- if the flush of the underlying stream failed
-
getChannel
public java.nio.channels.FileChannel getChannel()
Get the channel associated with this file. Note that this returns the channel of the associated RandomAccessFile. Note that since the BufferedFile buffers the I/O's to the underlying file, the offset of the channel may be different than the offset of the BufferedFile. This is different than for a RandomAccessFile where the offsets are guaranteed to be the same.- Returns:
- the file channel
-
getFD
public java.io.FileDescriptor getFD() throws java.io.IOExceptionGet the file descriptor associated with this stream. Note that this returns the file descriptor of the associated RandomAccessFile.- Returns:
- the file descriptor
- Throws:
java.io.IOException- if the descriptor could not be accessed.
-
getFilePointer
public long getFilePointer()
Get the current offset into the file.- Specified by:
getFilePointerin interfaceRandomAccess- Returns:
- the current position in the stream.
-
length
public long length() throws java.io.IOException- Returns:
- the current length of the file.
- Throws:
java.io.IOException- if the operation failed
-
mark
public void mark(int readlimit) throws java.io.IOExceptionDescription copied from interface:ArrayDataInputSee the general contract of themarkmethod ofInputStream.- Specified by:
markin interfaceArrayDataInput- Parameters:
readlimit- the maximum limit of bytes that can be read before the mark position becomes invalid.- Throws:
java.io.IOException- if the operation failed- See Also:
BufferedInputStream.reset()
-
needBuffer
private void needBuffer(int need) throws java.io.IOException- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException- Returns:
- Read a byte.
- Throws:
java.io.IOException- if the underlying read operation fails
-
read
public int read(boolean[] b) throws java.io.IOExceptionDescription copied from interface:ArrayDataInputRead an array of boolean's.- Specified by:
readin interfaceArrayDataInput- Parameters:
b- array of boolean's.- Returns:
- number of bytes read.
- Throws:
java.io.IOException- if one of the underlying read operations failed
-
read
public int read(boolean[] b, int start, int length) throws java.io.IOExceptionDescription copied from interface:ArrayDataInputRead a segment of an array of boolean's.- Specified by:
readin interfaceArrayDataInput- Parameters:
b- array of boolean's.start- start index in the arraylength- number of array elements to read- Returns:
- number of bytes read.
- Throws:
java.io.IOException- if one of the underlying read operations failed
-
read
public int read(byte[] buf) throws java.io.IOExceptionDescription copied from interface:ArrayDataInputRead an array of byte's.- Specified by:
readin interfaceArrayDataInput- Parameters:
buf- array of byte's.- Returns:
- number of bytes read.
- Throws:
java.io.IOException- if one of the underlying read operations failed- See Also:
DataInput.readFully(byte[])
-
read
public int read(byte[] buf, int offset, int len) throws java.io.IOExceptionDescription copied from interface:ArrayDataInputRead a segment of an array of byte's.- Specified by:
readin interfaceArrayDataInput- Parameters:
buf- array of byte's.offset- start index in the arraylen- number of array elements to read- Returns:
- number of bytes read.
- Throws:
java.io.IOException- if one of the underlying read operations failed- See Also:
ArrayDataInput.readFully(byte[], int, int)
-
read
public int read(char[] c) throws java.io.IOExceptionDescription copied from interface:ArrayDataInputRead an array of char's.- Specified by:
readin interfaceArrayDataInput- Parameters:
c- array of char's.- Returns:
- number of bytes read.
- Throws:
java.io.IOException- if one of the underlying read operations failed
-
read
public int read(char[] c, int start, int length) throws java.io.IOExceptionDescription copied from interface:ArrayDataInputRead a segment of an array of char's.- Specified by:
readin interfaceArrayDataInput- Parameters:
c- array of char's.start- start index in the arraylength- number of array elements to read- Returns:
- number of bytes read.
- Throws:
java.io.IOException- if one of the underlying read operations failed
-
read
public int read(double[] d) throws java.io.IOExceptionDescription copied from interface:ArrayDataInputRead an array of double's.- Specified by:
readin interfaceArrayDataInput- Parameters:
d- array of double's.- Returns:
- number of bytes read.
- Throws:
java.io.IOException- if one of the underlying read operations failed
-
read
public int read(double[] d, int start, int length) throws java.io.IOExceptionDescription copied from interface:ArrayDataInputRead a segment of an array of double's.- Specified by:
readin interfaceArrayDataInput- Parameters:
d- array of double's.start- start index in the arraylength- number of array elements to read- Returns:
- number of bytes read.
- Throws:
java.io.IOException- if one of the underlying read operations failed
-
read
public int read(float[] f) throws java.io.IOExceptionDescription copied from interface:ArrayDataInputRead an array of float's.- Specified by:
readin interfaceArrayDataInput- Parameters:
f- array of float's.- Returns:
- number of bytes read.
- Throws:
java.io.IOException- if one of the underlying read operations failed
-
read
public int read(float[] f, int start, int length) throws java.io.IOExceptionDescription copied from interface:ArrayDataInputRead a segment of an array of float's.- Specified by:
readin interfaceArrayDataInput- Parameters:
f- array of float's.start- start index in the arraylength- number of array elements to read- Returns:
- number of bytes read.
- Throws:
java.io.IOException- if one of the underlying read operations failed
-
read
public int read(int[] i) throws java.io.IOExceptionDescription copied from interface:ArrayDataInputRead an array of int's.- Specified by:
readin interfaceArrayDataInput- Parameters:
i- array of int's.- Returns:
- number of bytes read.
- Throws:
java.io.IOException- if one of the underlying read operations failed
-
read
public int read(int[] i, int start, int length) throws java.io.IOExceptionDescription copied from interface:ArrayDataInputRead a segment of an array of int's.- Specified by:
readin interfaceArrayDataInput- Parameters:
i- array of int's.start- start index in the arraylength- number of array elements to read- Returns:
- number of bytes read.
- Throws:
java.io.IOException- if one of the underlying read operations failed
-
read
public int read(long[] l) throws java.io.IOExceptionDescription copied from interface:ArrayDataInputRead a segment of an array of long's.- Specified by:
readin interfaceArrayDataInput- Parameters:
l- array of long's.- Returns:
- number of bytes read.
- Throws:
java.io.IOException- if one of the underlying read operations failed
-
read
public int read(long[] l, int start, int length) throws java.io.IOExceptionDescription copied from interface:ArrayDataInputRead a segment of an array of long's.- Specified by:
readin interfaceArrayDataInput- Parameters:
l- array of long's.start- start index in the arraylength- number of array elements to read- Returns:
- number of bytes read.
- Throws:
java.io.IOException- if one of the underlying read operations failed
-
read
public int read(short[] s) throws java.io.IOExceptionDescription copied from interface:ArrayDataInputRead an array of short's.- Specified by:
readin interfaceArrayDataInput- Parameters:
s- array of short's.- Returns:
- number of bytes read.
- Throws:
java.io.IOException- if one of the underlying read operations failed
-
read
public int read(short[] s, int start, int length) throws java.io.IOExceptionDescription copied from interface:ArrayDataInputRead a segment of an array of short's.- Specified by:
readin interfaceArrayDataInput- Parameters:
s- array of short's.start- start index in the arraylength- number of array elements to read- Returns:
- number of bytes read.
- Throws:
java.io.IOException- if one of the underlying read operations failed
-
readArray
@Deprecated public int readArray(java.lang.Object o) throws java.io.IOExceptionDeprecated.Description copied from interface:ArrayDataInputRead a generic (possibly multidimensional) primitive array. An Object[] array is also a legal argument if each element of the array is a legal.The ArrayDataInput classes do not support String input since it is unclear how one would read in an Array of strings.
- Specified by:
readArrayin interfaceArrayDataInput- Parameters:
o- A [multidimensional] primitive (or Object) array.- Returns:
- number of bytes read.
- Throws:
java.io.IOException- if the underlying stream failed
-
readBoolean
public boolean readBoolean() throws java.io.IOException- Specified by:
readBooleanin interfacejava.io.DataInput- Throws:
java.io.IOException
-
readByte
public byte readByte() throws java.io.IOException- Specified by:
readBytein interfacejava.io.DataInput- Throws:
java.io.IOException
-
readChar
public char readChar() throws java.io.IOException- Specified by:
readCharin interfacejava.io.DataInput- Throws:
java.io.IOException
-
readDouble
public double readDouble() throws java.io.IOException- Specified by:
readDoublein interfacejava.io.DataInput- Throws:
java.io.IOException
-
readFloat
public float readFloat() throws java.io.IOException- Specified by:
readFloatin interfacejava.io.DataInput- Throws:
java.io.IOException
-
readFully
public void readFully(byte[] b) throws java.io.IOException- Specified by:
readFullyin interfacejava.io.DataInput- Throws:
java.io.IOException
-
readFully
public void readFully(byte[] b, int off, int len) throws java.io.IOExceptionDescription copied from interface:ArrayDataInputRead a buffer and signal an EOF if the requested elements cannot be read. This differs from read(b,off,len) since that call will not signal and end of file unless no bytes can be read. However both of these routines will attempt to fill their buffers completely.- Specified by:
readFullyin interfaceArrayDataInput- Specified by:
readFullyin interfacejava.io.DataInput- Parameters:
b- The input buffer.off- The requested offset into the buffer.len- The number of bytes requested.- Throws:
java.io.IOException
-
readInt
public int readInt() throws java.io.IOException- Specified by:
readIntin interfacejava.io.DataInput- Throws:
java.io.IOException
-
readLArray
public long readLArray(java.lang.Object o) throws java.io.IOExceptionDescription copied from interface:ArrayDataInputRead an object. An EOF will be signaled if the object cannot be fully read. This version works even if the underlying data is more than 2 Gigabytes.- Specified by:
readLArrayin interfaceArrayDataInput- Parameters:
o- The object to be read. This object should be a primitive (possibly multi-dimensional) array.- Returns:
- number of bytes read.
- Throws:
java.io.IOException- if the underlying stream failed
-
readLine
public java.lang.String readLine() throws java.io.IOExceptionRead a line of input.- Specified by:
readLinein interfacejava.io.DataInput- Returns:
- the next line.
- Throws:
java.io.IOException
-
readLong
public long readLong() throws java.io.IOException- Specified by:
readLongin interfacejava.io.DataInput- Throws:
java.io.IOException
-
readShort
public short readShort() throws java.io.IOException- Specified by:
readShortin interfacejava.io.DataInput- Throws:
java.io.IOException
-
readUnsignedByte
public int readUnsignedByte() throws java.io.IOException- Specified by:
readUnsignedBytein interfacejava.io.DataInput- Throws:
java.io.IOException
-
readUnsignedShort
public int readUnsignedShort() throws java.io.IOException- Specified by:
readUnsignedShortin interfacejava.io.DataInput- Throws:
java.io.IOException
-
readUTF
public java.lang.String readUTF() throws java.io.IOException- Specified by:
readUTFin interfacejava.io.DataInput- Throws:
java.io.IOException
-
reset
public void reset() throws java.io.IOExceptionDescription copied from interface:ArrayDataInputSee the general contract of theresetmethod ofInputStream.If
markposis-1(no mark has been set or the mark has been invalidated), anIOExceptionis thrown. Otherwise,posis set equal tomarkpos.- Specified by:
resetin interfaceArrayDataInput- Throws:
java.io.IOException- if this stream has not been marked or, if the mark has been invalidated, or the stream has been closed by invoking itsFitsIO.close()method, or an I/O error occurs.- See Also:
BufferedInputStream.mark(int)
-
seek
public void seek(long offsetFromStart) throws java.io.IOExceptionDescription copied from interface:RandomAccessMove to a specified location in the stream.- Specified by:
seekin interfaceRandomAccess- Parameters:
offsetFromStart- set the offset messured from the start- Throws:
java.io.IOException- if the operation fails
-
setLength
public void setLength(long newLength) throws java.io.IOExceptionSet the length of the file. This method calls the method of the same name in RandomAccessFile which is only available in JDK1.2 and greater. This method may be deleted for compilation with earlier versions.- Parameters:
newLength- The number of bytes at which the file is set.- Throws:
java.io.IOException- if the resizing of the underlying stream fails
-
skip
public long skip(long offset) throws java.io.IOExceptionDescription copied from interface:ArrayDataInputSkip the number of bytes. This differs from the skip method in that it will throw an EOF if a forward skip cannot be fully accomplished... (However that isn't supposed to happen with a random access file, so there is probably no operational difference).- Specified by:
skipin interfaceArrayDataInput- Parameters:
offset- the number of bytes to skip- Returns:
- the number of bytes really skipped
- Throws:
java.io.IOException- if the underlying stream failed
-
skipAllBytes
public void skipAllBytes(int toSkip) throws java.io.IOExceptionDescription copied from interface:ArrayDataInputSkip the number of bytes. This differs from the skip method in that it will throw an EOF if a forward skip cannot be fully accomplished... (However that isn't supposed to happen with a random access file, so there is probably no operational difference).- Specified by:
skipAllBytesin interfaceArrayDataInput- Parameters:
toSkip- the number of bytes to skip- Throws:
java.io.IOException- if the underlying stream failed
-
skipAllBytes
public void skipAllBytes(long toSkip) throws java.io.IOExceptionDescription copied from interface:ArrayDataInputSkip the number of bytes. This differs from the skip method in that it will throw an EOF if a forward skip cannot be fully accomplished... (However that isn't supposed to happen with a random access file, so there is probably no operational difference).- Specified by:
skipAllBytesin interfaceArrayDataInput- Parameters:
toSkip- the number of bytes to skip- Throws:
java.io.IOException- if the underlying stream failed
-
skipBytes
public int skipBytes(int n) throws java.io.IOException- Specified by:
skipBytesin interfacejava.io.DataInput- Throws:
java.io.IOException
-
write
public void write(boolean[] b) throws java.io.IOExceptionDescription copied from interface:ArrayDataOutputWrite an array of boolean's.- Specified by:
writein interfaceArrayDataOutput- Parameters:
b- array of boolean's.- Throws:
java.io.IOException- if one of the underlying write operations failed
-
write
public void write(boolean[] b, int start, int length) throws java.io.IOExceptionDescription copied from interface:ArrayDataOutputWrite a segment of an array of boolean's.- Specified by:
writein interfaceArrayDataOutput- Parameters:
b- array of boolean's.start- start index in the arraylength- number of array elements to write- Throws:
java.io.IOException- if one of the underlying write operations failed
-
write
public void write(byte[] buf) throws java.io.IOException- Specified by:
writein interfacejava.io.DataOutput- Throws:
java.io.IOException
-
write
public void write(byte[] buf, int offset, int length) throws java.io.IOException- Specified by:
writein interfacejava.io.DataOutput- Throws:
java.io.IOException
-
write
public void write(char[] c) throws java.io.IOExceptionDescription copied from interface:ArrayDataOutputWrite an array of char's.- Specified by:
writein interfaceArrayDataOutput- Parameters:
c- array of char's.- Throws:
java.io.IOException- if one of the underlying write operations failed
-
write
public void write(char[] c, int start, int length) throws java.io.IOExceptionDescription copied from interface:ArrayDataOutputWrite a segment of an array of char's.- Specified by:
writein interfaceArrayDataOutput- Parameters:
c- array of char's.start- start index in the arraylength- number of array elements to write- Throws:
java.io.IOException- if one of the underlying write operations failed
-
write
public void write(double[] d) throws java.io.IOExceptionDescription copied from interface:ArrayDataOutputWrite an array of double's.- Specified by:
writein interfaceArrayDataOutput- Parameters:
d- array of double's.- Throws:
java.io.IOException- if one of the underlying write operations failed
-
write
public void write(double[] d, int start, int length) throws java.io.IOExceptionDescription copied from interface:ArrayDataOutputWrite a segment of an array of double's.- Specified by:
writein interfaceArrayDataOutput- Parameters:
d- array of double's.start- start index in the arraylength- number of array elements to write- Throws:
java.io.IOException- if one of the underlying write operations failed
-
write
public void write(float[] f) throws java.io.IOExceptionDescription copied from interface:ArrayDataOutputWrite an array of float's.- Specified by:
writein interfaceArrayDataOutput- Parameters:
f- array of float's.- Throws:
java.io.IOException- if one of the underlying write operations failed
-
write
public void write(float[] f, int start, int length) throws java.io.IOExceptionDescription copied from interface:ArrayDataOutputWrite a segment of an array of float's.- Specified by:
writein interfaceArrayDataOutput- Parameters:
f- array of float's.start- start index in the arraylength- number of array elements to write- Throws:
java.io.IOException- if one of the underlying write operations failed
-
write
public void write(int buf) throws java.io.IOException- Specified by:
writein interfacejava.io.DataOutput- Throws:
java.io.IOException
-
write
public void write(int[] i) throws java.io.IOExceptionDescription copied from interface:ArrayDataOutputWrite an array of int's.- Specified by:
writein interfaceArrayDataOutput- Parameters:
i- array of int's- Throws:
java.io.IOException- if one of the underlying write operations failed
-
write
public void write(int[] i, int start, int length) throws java.io.IOExceptionDescription copied from interface:ArrayDataOutputWrite a segment of an array of int's.- Specified by:
writein interfaceArrayDataOutput- Parameters:
i- array of int'sstart- start index in the arraylength- number of array elements to write- Throws:
java.io.IOException- if one of the underlying write operations failed
-
write
public void write(long[] l) throws java.io.IOExceptionDescription copied from interface:ArrayDataOutputWrite an array of longs.- Specified by:
writein interfaceArrayDataOutput- Parameters:
l- array of longs- Throws:
java.io.IOException- if one of the underlying write operations failed
-
write
public void write(long[] l, int start, int length) throws java.io.IOExceptionDescription copied from interface:ArrayDataOutputWrite a segment of an array of longs.- Specified by:
writein interfaceArrayDataOutput- Parameters:
l- array of longsstart- start index in the arraylength- number of array elements to write- Throws:
java.io.IOException- if one of the underlying write operations failed
-
write
public void write(short[] s) throws java.io.IOExceptionDescription copied from interface:ArrayDataOutputWrite an array of shorts.- Specified by:
writein interfaceArrayDataOutput- Parameters:
s- the value to write- Throws:
java.io.IOException- if one of the underlying write operations failed
-
write
public void write(short[] s, int start, int length) throws java.io.IOExceptionDescription copied from interface:ArrayDataOutputWrite a segment of an array of shorts.- Specified by:
writein interfaceArrayDataOutput- Parameters:
s- the value to writestart- start index in the arraylength- number of array elements to write- Throws:
java.io.IOException- if one of the underlying write operations failed
-
write
public void write(java.lang.String[] s) throws java.io.IOExceptionDescription copied from interface:ArrayDataOutputWrite an array of Strings. Equivalent to calling writeBytes for the selected elements.- Specified by:
writein interfaceArrayDataOutput- Parameters:
s- the array to write- Throws:
java.io.IOException- if one of the underlying write operations failed
-
write
public void write(java.lang.String[] s, int start, int length) throws java.io.IOExceptionDescription copied from interface:ArrayDataOutputWrite a segment of an array of Strings. Equivalent to calling writeBytes for the selected elements.- Specified by:
writein interfaceArrayDataOutput- Parameters:
s- the array to writestart- start index in the arraylength- number of array elements to write- Throws:
java.io.IOException- if one of the underlying write operations failed
-
writeArray
public void writeArray(java.lang.Object o) throws java.io.IOExceptionDescription copied from interface:ArrayDataOutputThis routine provides efficient writing of arrays of any primitive type. The String class is also handled but it is an error to invoke this method with an object that is not an array of these types. If the array is multidimensional, then it calls itself recursively to write the entire array. Strings are written using the standard 1 byte format (i.e., as in writeBytes). If the array is an array of objects, then writePrimitiveArray will be called for each element of the array.- Specified by:
writeArrayin interfaceArrayDataOutput- Parameters:
o- The object to be written. It must be an array of a primitive type, Object, or String.- Throws:
java.io.IOException- if one of the underlying write operations failed
-
writeBoolean
public void writeBoolean(boolean b) throws java.io.IOException- Specified by:
writeBooleanin interfacejava.io.DataOutput- Throws:
java.io.IOException
-
writeByte
public void writeByte(int b) throws java.io.IOException- Specified by:
writeBytein interfacejava.io.DataOutput- Throws:
java.io.IOException
-
writeBytes
public void writeBytes(java.lang.String s) throws java.io.IOException- Specified by:
writeBytesin interfacejava.io.DataOutput- Throws:
java.io.IOException
-
writeChar
public void writeChar(int c) throws java.io.IOException- Specified by:
writeCharin interfacejava.io.DataOutput- Throws:
java.io.IOException
-
writeChars
public void writeChars(java.lang.String s) throws java.io.IOException- Specified by:
writeCharsin interfacejava.io.DataOutput- Throws:
java.io.IOException
-
writeDouble
public void writeDouble(double d) throws java.io.IOException- Specified by:
writeDoublein interfacejava.io.DataOutput- Throws:
java.io.IOException
-
writeFloat
public void writeFloat(float f) throws java.io.IOException- Specified by:
writeFloatin interfacejava.io.DataOutput- Throws:
java.io.IOException
-
writeInt
public void writeInt(int i) throws java.io.IOException- Specified by:
writeIntin interfacejava.io.DataOutput- Throws:
java.io.IOException
-
writeLong
public void writeLong(long l) throws java.io.IOException- Specified by:
writeLongin interfacejava.io.DataOutput- Throws:
java.io.IOException
-
writeShort
public void writeShort(int s) throws java.io.IOException- Specified by:
writeShortin interfacejava.io.DataOutput- Throws:
java.io.IOException
-
writeUTF
public void writeUTF(java.lang.String s) throws java.io.IOException- Specified by:
writeUTFin interfacejava.io.DataOutput- Throws:
java.io.IOException
-
-