Package com.irurueta.geometry.io
Class MappedFileReaderAndWriter
java.lang.Object
com.irurueta.geometry.io.AbstractFileReaderAndWriter
com.irurueta.geometry.io.MappedFileReaderAndWriter
- All Implemented Interfaces:
Closeable,AutoCloseable
This class provides methods to access file data at random positions using
memory mapping for faster data access.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MappedByteBufferBuffer where data is stored.private final RandomAccessFileUnderlying input file.private booleanInternal value indicating if read has been produced. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this file stream and releases any system resources associated with the stream.longReturns the current offset in this file.booleanDetermines whether end of file has been reached (next read() will return -1). or not.intread()Reads one byte at current file position and advances one position.intread(byte[] b) Reads up to b.length bytes of data from this file into an array of bytes.intread(byte[] b, int off, int len) Reads up to len bytes of data from this file into an array of bytes.booleanReads a boolean from this file.bytereadByte()Reads a signed eight-bit value from this file.doubleReads a double from this file.doublereadDouble(EndianType endianType) Reads a double from this file.floatReads a float from this file.floatreadFloat(EndianType endianType) Reads a float from this file.intreadInt()Reads a signed 32-bit integer from this file.intreadInt(EndianType endianType) Reads a signed 32-bit integer from this file.readLine()Reads the next line of text from this file.longreadLong()Reads a signed 64-bit integer from this file.longreadLong(EndianType endianType) Reads a signed 64-bit integer from this file.shortReads a signed 16-bit number from this file.shortreadShort(EndianType endianType) Reads a signed 16-bit number from this file assuming that file is encoded using provided endian type.shortReads an unsigned eight-bit number from this file.longReads an unsigned 32-bit integer from this file.longreadUnsignedInt(EndianType endianType) Reads an unsigned 32-bit integer from this file.intReads an unsigned 16-bit number from this file.intreadUnsignedShort(EndianType endianType) Reads an unsigned 16-bit number from this file.Sequentially reads characters starting at current file position until one of the characters in provided pattern is found.voidseek(long pos) Sets the file-pointer offset, measured from the beginning of this file, at which the next read or write occurs.longskip(long n) Attempts to skip over n byte of input discarding the skipped bytes.voidwrite(byte[] b) Writes b.length bytes from the specified byte array to this file, starting at the current file pointer.voidwrite(byte[] b, int off, int len) Writes len bytes from the specified byte array starting at offset off to this file.voidwrite(int b) Writes the specified byte to this file.voidwriteASCII(String s) Writes the string to the file as a sequence of bytes.voidwriteBoolean(boolean v) Writes a boolean to the file as a one-byte value.voidwriteByte(byte v) Writes a byte to the file as a one-byte value.voidwriteDouble(double v) Converts the double argument to a long using the doubleToLongBits method in class Double, and then writes that long value to the file as an eight byte quantity, high byte first.voidwriteDouble(double v, EndianType endianType) Converts the double argument to a long using the doubleToLongBits method in class Double, and then writes that long value to the file as an eight byte quantity, using provided endian type.voidwriteFloat(float v) Converts the float argument to an int using the floatToIntBits method in class Float, and then write that int value to the file as a four-byte quantity, high byte first.voidwriteFloat(float v, EndianType endianType) Converts the float argument to an int using the floatToIntBits method in class Float, and then write that int value to the file as a four-byte quantity, using provided endian type.voidwriteInt(int v) Writes an int to the file as four bytes, high byte first.voidwriteInt(int v, EndianType endianType) Writes an int to the file as four bytes, using provided endian type.voidwriteLong(long v) Writes a long to the file as eight bytes, high byte first.voidwriteLong(long v, EndianType endianType) Writes a long to the file as eight bytes, using provided endian type.voidwriteShort(short v) Writes a short to the file as two bytes, high byte first.voidwriteShort(short v, EndianType endianType) Writes a short to the file as two bytes using provided endian type.voidwriteUnsignedByte(short v) Writes provided value in the range 0-255 as an unsigned byte.voidwriteUnsignedInt(long v) Writes an unsigned int to the file as four bytes, high byte first.voidwriteUnsignedInt(long v, EndianType endianType) Writes an unsigned int to the file as four bytes, using provided endian type.voidwriteUnsignedShort(int v) Writes an unsigned short to the file as two bytes, high byte first.voidwriteUnsignedShort(int v, EndianType endianType) Writes an unsigned short to the file as two bytes, using provided endian type.Methods inherited from class com.irurueta.geometry.io.AbstractFileReaderAndWriter
readWord
-
Field Details
-
randomAccessFile
Underlying input file. -
buffer
Buffer where data is stored. -
read
private boolean readInternal value indicating if read has been produced.
-
-
Constructor Details
-
MappedFileReaderAndWriter
Constructor.- Parameters:
f- file to read from or write to.mode- file opening mode (read only or read write).- Throws:
IOException- if an I/O error occurs .
-
-
Method Details
-
read
Reads one byte at current file position and advances one position.- Specified by:
readin classAbstractFileReaderAndWriter- Returns:
- Next byte of data or -1 if end of file is reached.
- Throws:
IOException- if an I/O error occurs. Not thrown if end-of-file has been reached.
-
read
Reads up to b.length bytes of data from this file into an array of bytes. This method blocks until at least one byte of input is available.- Specified by:
readin classAbstractFileReaderAndWriter- Parameters:
b- The buffer into which the data is read.- Returns:
- The total number of bytes read into the buffer, or -1 if there is no more data because the end of the file has been reached.
- Throws:
IOException- If the first byte cannot be read for any reason other than end of file, or if the file has been closed, or if some other I/O error occurs.
-
read
Reads up to len bytes of data from this file into an array of bytes. This method blocks until at least one byte of input is available. This method behaves in exactly the same way as the InputStream.read(byte[], int, int) method of InputStream.- Specified by:
readin classAbstractFileReaderAndWriter- Parameters:
b- the buffer into which the data is read.off- the start offset in array b at which the data is written.len- the maximum number of bytes read.- Returns:
- the total number of bytes read into the buffer, or -1 if there is no more data because the end of the file has been reached.
- Throws:
IOException- If the first byte cannot be read for any reason other than end of file, or if the random access file has been closed, or if some other I/O error occurs.
-
skip
public long skip(long n) Attempts to skip over n byte of input discarding the skipped bytes.This method may skip over some number of bytes, possibly zero. This may result from any of a number of conditions; reaching end of file before n bytes have been skipped is only one possibility. The actual number of bytes skipped is returned. If n is negative, no bytes are skipped.
- Specified by:
skipin classAbstractFileReaderAndWriter- Parameters:
n- the number of bytes to be skipped.- Returns:
- the actual number of bytes skipped.
-
write
Writes the specified byte to this file. The write starts at the current file pointer.- Specified by:
writein classAbstractFileReaderAndWriter- Parameters:
b- the byte to be written.- Throws:
IOException- if an I/O error occurs.
-
write
Writes b.length bytes from the specified byte array to this file, starting at the current file pointer.- Specified by:
writein classAbstractFileReaderAndWriter- Parameters:
b- the data.- Throws:
IOException- if an I/O error occurs.
-
write
Writes len bytes from the specified byte array starting at offset off to this file.- Specified by:
writein classAbstractFileReaderAndWriter- Parameters:
b- the data.off- the start offset in the data.len- the number of bytes to write.- Throws:
IOException- if an I/O error occurs.
-
getPosition
Returns the current offset in this file.- Specified by:
getPositionin classAbstractFileReaderAndWriter- Returns:
- the offset from the beginning of the file, in bytes, at which the next read or write occurs.
- Throws:
IOException- in an I/O error occurs.
-
isEndOfStream
Determines whether end of file has been reached (next read() will return -1). or not.- Specified by:
isEndOfStreamin classAbstractFileReaderAndWriter- Returns:
- True if end of file has been reached, false otherwise.
- Throws:
IOException- if an I/O error occurs..
-
seek
public void seek(long pos) Sets the file-pointer offset, measured from the beginning of this file, at which the next read or write occurs. Setting the offset beyond the end of the file will raise an exception.- Specified by:
seekin classAbstractFileReaderAndWriter- Parameters:
pos- the offset position, measured in bytes from the beginning of the file, at which to set the file pointer.
-
close
Closes this file stream and releases any system resources associated with the stream. A closed file cannot perform input or output operations and cannot be reopened. If this file has an associated channel then the channel is closed as well.- Throws:
IOException- if an I/O error occurs.
-
readBoolean
public boolean readBoolean()Reads a boolean from this file. This method reads a single byte from the file, starting at the current file pointer. A value of 0 represents false. Any other value represents true. This method blocks until the byte is read, the end of the stream is detected, or an exception is thrown.- Specified by:
readBooleanin classAbstractFileReaderAndWriter- Returns:
- the boolean value read.
-
readByte
public byte readByte()Reads a signed eight-bit value from this file. This method reads a byte from the file, starting from the current file pointer. If the byte read is b, where 0 <= b <= 255, then the result is: (byte)(b) This method blocks until the byte is read, the end of the stream is detected, or an exception is thrown.- Specified by:
readBytein classAbstractFileReaderAndWriter- Returns:
- the next byte of this file is a signed eight-bit byte.
-
readUnsignedByte
public short readUnsignedByte()Reads an unsigned eight-bit number from this file. This method reads a byte from this file, starting at the current file pointer, and returns that byte. This method blocks until the byte is read, the end of the stream is detected, or an exception is thrown.- Specified by:
readUnsignedBytein classAbstractFileReaderAndWriter- Returns:
- the next byte of this file, interpreted as an unsigned eight-bit number.
-
readShort
public short readShort()Reads a signed 16-bit number from this file. The method reads two byte from this file, starting at the current file pointer. If the two bytes read, in order, are b1 and b2, where each of the two values is between 0 and 255, inclusive, then the result is equal to: (short)(b1 << 8 | b2). This method blocks until the two bytes are read, the end of the stream is detected, or an exception is thrown.- Specified by:
readShortin classAbstractFileReaderAndWriter- Returns:
- the next two bytes of this file, interpreted as a signed 16-bit number.
-
readShort
Reads a signed 16-bit number from this file assuming that file is encoded using provided endian type. If endian type is big endian type, then natural binary order is preserved, otherwise byte order is reversed. This method blocks until the two bytes of the 16-bit number are read, the end of the stream is detected, or an exception is thrown.- Specified by:
readShortin classAbstractFileReaderAndWriter- Parameters:
endianType- Endian type. Big endian preserves natural binary order, little endian reverses byte order.- Returns:
- the next two bytes of this file, interpreted as a signed 16-bit number encoded in provided endian type.
-
readUnsignedShort
public int readUnsignedShort()Reads an unsigned 16-bit number from this file. This method reads two bytes from this file, starting at the current file pointer. If the bytes read, in order, are b1 and b2, where 0 <= b1, b2 <= 255, then the result is equal to: (b1 << 8) | b2 This method blocks until the two bytes are read, the end of the stream is detected, or an exception is thrown.- Specified by:
readUnsignedShortin classAbstractFileReaderAndWriter- Returns:
- the next two bytes of this file, interpreted as an unsigned 16-bit integer.
-
readUnsignedShort
Reads an unsigned 16-bit number from this file. This method reads two bytes from this file, starting at the current file pointer and using provided endian type. If endian type is big endian, then natural binary order is preserved, otherwise byte order is reversed. This method blocks until the two bytes are read, the end of the stream is detected, or an exception is thrown.- Specified by:
readUnsignedShortin classAbstractFileReaderAndWriter- Parameters:
endianType- Endian type. Big endian preserves natural binary order, little endian reverses byte order.- Returns:
- the next two bytes of this file, interpreted as an unsigned 16-bit integer.
-
readInt
public int readInt()Reads a signed 32-bit integer from this file. This method reads 4 bytes from the file, starting at the current file pointer. If the bytes read, in order, are b1, b2, b3, and b4, where 0 <= b1, b3, b4 <= 255, then the result is equal to: (b1 << 24) | (b2 << 16) + (b3 << 8) + b4. This method blocks until the four bytes are read, the end of the stream is detected, or an exception is thrown.- Specified by:
readIntin classAbstractFileReaderAndWriter- Returns:
- the next four bytes of this file, interpreted as an int.
-
readInt
Reads a signed 32-bit integer from this file. This method reads 4 bytes from the file, starting at the current file pointer and using provided endian type. If endian type is big endian, then natural binary order is preserved, otherwise byte order is reversed. This method blocks until the four bytes are read, the end of the stream is detected, or an exception is thrown.- Specified by:
readIntin classAbstractFileReaderAndWriter- Parameters:
endianType- Endian type. Big endian preserves natural binary order, little endian reverses byte order.- Returns:
- the next four bytes of this file, interpreted as an int.
-
readUnsignedInt
public long readUnsignedInt()Reads an unsigned 32-bit integer from this file. This method reads 4 bytes from the file, starting at the current file pointer. If the bytes read, in order, are b1, b2, b3, and b4, where 0 <= b1, b3, b4 <= 255, then the result is equal to: (b1 << 24) | (b2 << 16) + (b3 << 8) + b4. This method blocks until the four bytes are read, the end of the stream is detected, or an exception is thrown.- Specified by:
readUnsignedIntin classAbstractFileReaderAndWriter- Returns:
- the next four bytes of this file, interpreted as a long.
-
readUnsignedInt
Reads an unsigned 32-bit integer from this file. This method reads 4 bytes from the file, starting at the current file pointer and using provided endian type. If endian type is big endian, then natural binary order is preserved, otherwise byte order is reversed. This method blocks until the four bytes are read, the end of the stream is detected, or an exception is thrown.- Specified by:
readUnsignedIntin classAbstractFileReaderAndWriter- Parameters:
endianType- Endian type. Big endian preserves natural binary order, little endian reverses byte order.- Returns:
- the next four bytes of this file, interpreted as an int.
-
readLong
public long readLong()Reads a signed 64-bit integer from this file. This method reads eight bytes from the file, starting at the current file pointer. If the bytes read, in order, are b1, b2, b3, b4, b5, b6, b7, and b8, where: 0 <= b1, b2, b3, b4. b5. b6. b7. b8 <= 255, then the result is equal to: ((long)b1 << 56) + ((long)b2 << 48) + ((long)b3 << 40) + ((long)b4 << 32) + ((long)b5 << 24) + ((long)b6 << 16) + ((long)b7 << 8) + b8 This method blocks until the eight bytes are read, the end of the stream is detected, or an exception is thrown.- Specified by:
readLongin classAbstractFileReaderAndWriter- Returns:
- the next eight bytes of this file, interpreted as a long
-
readLong
Reads a signed 64-bit integer from this file. This method reads eight bytes from the file, starting at the current file pointer and using provided endian type. If endian type is big endian, then natural binary order is preserved, otherwise byte order is reversed. This method blocks until the eight bytes are read, the end of the stream is detected, or an exception is thrown.- Specified by:
readLongin classAbstractFileReaderAndWriter- Parameters:
endianType- Endian type. Big endian preserves natural binary order, little endian reverses byte order.- Returns:
- the next eight bytes of this file, interpreted as a long
-
readFloat
public float readFloat()Reads a float from this file. This method reads an int value, starting at the current file pointer, as if by the readInt method and then converts that in to a float using the intBitsToFloat method in class Float. This method blocks until the four bytes are read, the end of the stream is detected, or an exception is thrown.- Specified by:
readFloatin classAbstractFileReaderAndWriter- Returns:
- the next four bytes of this file, interpreted as a float.
-
readFloat
Reads a float from this file. This method reads four bytes using provided endian type. If endian type is big endian, then natural binary order is preserved, otherwise byte order is reversed. This method blocks until the four bytes are read, the end of the stream is detected, or an exception is thrown.- Specified by:
readFloatin classAbstractFileReaderAndWriter- Parameters:
endianType- Endian type. Big endian preserves natural binary order, little endian reverses byte order.- Returns:
- the next four bytes of this file, interpreted as a float.
-
readDouble
public double readDouble()Reads a double from this file. This method reads a long value, starting at the current file pointer, as if by the readLong method and then converts that long to a double using the longBitsToDouble method in class Double. This method blocks until the eight bytes are read, the end of the stream is detected, or an exception is thrown.- Specified by:
readDoublein classAbstractFileReaderAndWriter- Returns:
- the next eight bytes of this file, interpreted as a double.
-
readDouble
Reads a double from this file. This method reads eight bytes using provided endian type. If endian type is big endian, then natural binary order is preserved, otherwise byte order is reversed. This method blocks until the eight bytes are read, the end of the stream is detected, or an exception is thrown.- Specified by:
readDoublein classAbstractFileReaderAndWriter- Parameters:
endianType- Endian type. Big endian preserves natural binary order, little endian reverses byte order.- Returns:
- the next eight bytes of this file, interpreted as a double.
-
readLine
Reads the next line of text from this file. This method successively reads bytes from the file, starting at the current file pointer, until it reaches a line terminator of the end of the file. Each byte is converted into a character by taking the byte's value for the lower eight bits of the character and setting the high eight bits of the character to zero. This method does not, therefore, support the full Unicode character set. A line of text is terminated by a carriage-return character ('\r'), a newline character('\n'), a carriage-return character immediately followed by a newline character, or the end of the file. Line-terminating characters are discarded and are not included as part of the string returned. This method blocks until a newline character is read, a carriage return and the byte following it are read (to see if it is a newline), the end of the file is reached, or an exception is thrown.- Specified by:
readLinein classAbstractFileReaderAndWriter- Returns:
- the next line of text from this file, or null if end of file is encountered before even one byte is read.
-
readUntilAnyOfTheseCharactersIsFound
Sequentially reads characters starting at current file position until one of the characters in provided pattern is found. All characters read so far will be returned without including any of the pattern characters.- Specified by:
readUntilAnyOfTheseCharactersIsFoundin classAbstractFileReaderAndWriter- Parameters:
pattern- Stop characters to stop reading when they are found.- Returns:
- String read so far until any of the pattern characters was found or an empty string if the first character is contained in provided pattern.
- Throws:
IllegalArgumentException- if no pattern characters are provided.
-
writeBoolean
Writes a boolean to the file as a one-byte value. The value true is written out as the value (byte)1; the value false is written out as the value (byte)0. The write starts at the current position of the file pointer.- Specified by:
writeBooleanin classAbstractFileReaderAndWriter- Parameters:
v- a boolean value to be written.- Throws:
IOException- if an I/O error occurs.
-
writeByte
Writes a byte to the file as a one-byte value. The write starts at the current position of the file pointer.- Specified by:
writeBytein classAbstractFileReaderAndWriter- Parameters:
v- a byte value to be written.- Throws:
IOException- if an I/O error occurs.
-
writeUnsignedByte
Writes provided value in the range 0-255 as an unsigned byte. The write starts at the current position of the file pointer.- Specified by:
writeUnsignedBytein classAbstractFileReaderAndWriter- Parameters:
v- a value to be written as an unsigned byte.- Throws:
IOException- if an I/O error occurs.
-
writeShort
Writes a short to the file as two bytes, high byte first. The write starts at the current position of the file pointer.- Specified by:
writeShortin classAbstractFileReaderAndWriter- Parameters:
v- a short to be written.- Throws:
IOException- if an I/O error occurs.
-
writeShort
Writes a short to the file as two bytes using provided endian type. If endian type is big endian, then natural byte order is preserved (and high byte is written first), if little endian order is chosen, then byte order is reversed- Specified by:
writeShortin classAbstractFileReaderAndWriter- Parameters:
v- a short to be writtenendianType- endian type. If it is big endian, natural byte order is preserved, otherwise byte order is reversed.- Throws:
IOException- if an I/O error occurs.
-
writeUnsignedShort
Writes an unsigned short to the file as two bytes, high byte first. Provided integer value is converted to an unsigned short by taking into account only the two lower bytes. The write starts at the current position of the file pointer.- Specified by:
writeUnsignedShortin classAbstractFileReaderAndWriter- Parameters:
v- an unsigned short to be written (int is converted to unsigned short).- Throws:
IOException- if an I/O error occurs.
-
writeUnsignedShort
Writes an unsigned short to the file as two bytes, using provided endian type. Provided integer value is converted to an unsigned short by taking into account only the two lower bytes. If endian type is big endian, then natural byte order is preserved (and high byte is written first), if little endian order is chosen, then byte order is reversed The write starts at the current position of the file pointer.- Specified by:
writeUnsignedShortin classAbstractFileReaderAndWriter- Parameters:
v- an unsigned short to be written (int is converted to unsigned short).endianType- endian type. If it is big endian, natural byte order is preserved, otherwise byte order is reversed.- Throws:
IOException- if an I/O error occurs.
-
writeInt
Writes an int to the file as four bytes, high byte first. The write starts at the current position of the file pointer.- Specified by:
writeIntin classAbstractFileReaderAndWriter- Parameters:
v- an int to be written.- Throws:
IOException- if an I/O error occurs.
-
writeInt
Writes an int to the file as four bytes, using provided endian type. If endian type is big endian, then natural byte order is preserved (and high byte is written first), if little endian order is chosen, then byte order is reversed. The write starts at the current position of the file pointer.- Specified by:
writeIntin classAbstractFileReaderAndWriter- Parameters:
v- an int to be written.endianType- endian type. If it is big endian, natural byte order is preserved, otherwise byte order is reversed.- Throws:
IOException- if an I/O error occurs.
-
writeUnsignedInt
Writes an unsigned int to the file as four bytes, high byte first. Provided integer value is converted to an unsigned int by taking into account only the four lower bytes. The write starts at the current position of the file pointer.- Specified by:
writeUnsignedIntin classAbstractFileReaderAndWriter- Parameters:
v- an unsigned int to be written (long is converted to unsigned int).- Throws:
IOException- if an I/O error occurs.
-
writeUnsignedInt
Writes an unsigned int to the file as four bytes, using provided endian type. Provided integer value is converted to an unsigned int by taking into account only the four lower bytes. If endian type is big endian, then natural byte order is preserved (and high byte is written first), if little endian order is chosen, then byte order is reversed. The write starts at the current position of the file pointer.- Specified by:
writeUnsignedIntin classAbstractFileReaderAndWriter- Parameters:
v- an unsigned int to be written (long is converted to unsigned short).endianType- endian type. If it is big endian, natural byte order is preserved, otherwise byte order is reversed.- Throws:
IOException- if an I/O error occurs.
-
writeLong
Writes a long to the file as eight bytes, high byte first. The write starts at the current position of the file pointer.- Specified by:
writeLongin classAbstractFileReaderAndWriter- Parameters:
v- a long to be written.- Throws:
IOException- if an I/O error occurs.
-
writeLong
Writes a long to the file as eight bytes, using provided endian type. If endian type is big endian, then natural byte order is preserved (and high byte is written first), if little endian order is chosen, then byte order is reversed. The write starts at the current position of the file pointer.- Specified by:
writeLongin classAbstractFileReaderAndWriter- Parameters:
v- a long to be written.endianType- endian type. If it is big endian, natural byte order is preserved, otherwise byte order is reversed.- Throws:
IOException- if an I/O error occurs.
-
writeFloat
Converts the float argument to an int using the floatToIntBits method in class Float, and then write that int value to the file as a four-byte quantity, high byte first. The write starts at the current position of the file pointer.- Specified by:
writeFloatin classAbstractFileReaderAndWriter- Parameters:
v- a float value to be written- Throws:
IOException- if an I/O error occurs.
-
writeFloat
Converts the float argument to an int using the floatToIntBits method in class Float, and then write that int value to the file as a four-byte quantity, using provided endian type. If endian type is big endian, then natural byte order is preserved (and high byte is written first), if little endian order is chosen, then byte order is reversed. The write starts at the current position of the file pointer.- Specified by:
writeFloatin classAbstractFileReaderAndWriter- Parameters:
v- a float value to be writtenendianType- endian type. If it is big endian, natural byte order is preserved, otherwise byte order is reversed.- Throws:
IOException- if an I/O error occurs.
-
writeDouble
Converts the double argument to a long using the doubleToLongBits method in class Double, and then writes that long value to the file as an eight byte quantity, high byte first. The write starts at the current position of the file pointer.- Specified by:
writeDoublein classAbstractFileReaderAndWriter- Parameters:
v- a double value to be written.- Throws:
IOException- if an I/O error occurs.
-
writeDouble
Converts the double argument to a long using the doubleToLongBits method in class Double, and then writes that long value to the file as an eight byte quantity, using provided endian type. If endian type is big endian, then natural byte order is preserved (and high byte is written first), if little endian order is chosen, then byte order is reversed. The write starts at the current position of the file pointer.- Specified by:
writeDoublein classAbstractFileReaderAndWriter- Parameters:
v- a double value to be written.endianType- endian type. If it is big endian, natural byte order is preserved, otherwise byte order is reversed.- Throws:
IOException- if an I/O error occurs.
-
writeASCII
Writes the string to the file as a sequence of bytes. Each character in the string is written out, in sequence, by discarding its high eight bits. The write starts at the current position of the file pointer.- Specified by:
writeASCIIin classAbstractFileReaderAndWriter- Parameters:
s- a string of bytes to be written.- Throws:
IOException- if an I/O error occurs.
-