RandomAccessReader

RandomAccessReader

Vue de l’ensemble

‘RandomAccessReader’ est une classe dans Aspose.PDF FOSS pour Java.Déduit de: ‘Closeable’.

Le lecteur d’accès aléatoire pour les fichiers PDF.

Cette classe fournit 18 méthodes pour travailler avec les objets RandomAccessReader dans des programmes Java. Les méthodologies disponibles comprennent: ‘close’, ‘findBackward’, findForward' , 'fromBytes', ‘fronBythesNoCopy', ’frolFile’, 'fraStream', ''getLength, ‘getPosition’,‘‘isEOF , ''peek et ‘read 4 méthode supplémentaires. Tous les membres publics sont accessibles à toute application Java après l'installation de l’Aspose.PDF FOSS pour le package Java . Propriétés : 'eOF', "longueur’, «position’.

Propriétés

NameTypeAccessDescription
positionlongReadReturns the current read position.
lengthlongReadReturns the total length of the data source.
eOFbooleanReadReturns {@code true} if the current position is at or past the end of data.

méthodes

SignatureDescription
fromFile(file: File)RandomAccessReaderCreates a reader backed by a file.
fromFile(path: Path)RandomAccessReaderCreates a reader backed by a file.
fromBytes(data: byte[])RandomAccessReaderCreates a reader backed by an in-memory byte array.
fromBytesNoCopy(data: byte[])RandomAccessReaderCreates a reader over the given array WITHOUT a defensive copy.
fromStream(is: InputStream)RandomAccessReaderCreates a reader by reading the entire input stream into memory.
getPosition()longReturns the current read position.
getLength()longReturns the total length of the data source.
seek(pos: long)Seeks to the given absolute position.
skip(n: long)Advances the position by the given number of bytes.
read()intReads a single byte at the current position and advances by one.
read(buf: byte[], off: int, len: int)intReads up to {@code len} bytes into the given array.
readFully(len: int)byte[]Reads exactly {@code length} bytes, throwing {@link EOFException} if not enough data is available.
peek()intReads the next byte without advancing the position.
readLine()StringReads an ASCII line (terminated by LF or CR+LF).
isEOF()booleanReturns {@code true} if the current position is at or past the end of data.
findBackward(pattern: byte[], startFrom: long)longSearches backward from {@code startFrom} for the given byte pattern.
findForward(pattern: byte[], startFrom: long)longSearches forward from the given position for the first occurrence of the pattern.
close()Closes this reader and releases any underlying resources.

Voir aussi

  • Aspose.PDF pour Java — API d’entreprise
 Français