Package org.apache.beam.sdk.io
Class FileIO.ReadableFile
- java.lang.Object
-
- org.apache.beam.sdk.io.FileIO.ReadableFile
-
- Enclosing class:
- FileIO
public static final class FileIO.ReadableFile extends java.lang.Object
A utility class for accessing a potentially compressed file.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(@Nullable java.lang.Object o)
Compression
getCompression()
Returns the method with which this file will be decompressed inopen()
.MatchResult.Metadata
getMetadata()
Returns theMatchResult.Metadata
of the file.int
hashCode()
java.nio.channels.ReadableByteChannel
open()
Returns aReadableByteChannel
reading the data from this file, potentially decompressing it usinggetCompression()
.java.nio.channels.SeekableByteChannel
openSeekable()
byte[]
readFullyAsBytes()
Returns the full contents of the file as bytes.java.lang.String
readFullyAsUTF8String()
Returns the full contents of the file as aString
decoded as UTF-8.java.lang.String
toString()
-
-
-
Method Detail
-
getMetadata
public MatchResult.Metadata getMetadata()
Returns theMatchResult.Metadata
of the file.
-
getCompression
public Compression getCompression()
Returns the method with which this file will be decompressed inopen()
.
-
open
public java.nio.channels.ReadableByteChannel open() throws java.io.IOException
Returns aReadableByteChannel
reading the data from this file, potentially decompressing it usinggetCompression()
.- Throws:
java.io.IOException
-
openSeekable
public java.nio.channels.SeekableByteChannel openSeekable() throws java.io.IOException
- Throws:
java.io.IOException
-
readFullyAsBytes
public byte[] readFullyAsBytes() throws java.io.IOException
Returns the full contents of the file as bytes.- Throws:
java.io.IOException
-
readFullyAsUTF8String
public java.lang.String readFullyAsUTF8String() throws java.io.IOException
Returns the full contents of the file as aString
decoded as UTF-8.- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(@Nullable java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-