public class NativeAzureFileSystem.NativeAzureFsOutputStream extends OutputStream implements org.apache.hadoop.fs.Syncable, org.apache.hadoop.fs.StreamCapabilities
| Constructor and Description |
|---|
NativeAzureFsOutputStream(OutputStream out,
String aKey,
String anEncodedKey) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
String |
getEncodedKey()
Get the blob name.
|
String |
getKey()
Get the blob name.
|
OutputStream |
getOutStream()
Get a reference to the wrapped output stream.
|
boolean |
hasCapability(String capability)
Propagate probe of stream capabilities to nested stream
(if supported), else return false.
|
void |
hflush() |
void |
hsync() |
void |
setEncodedKey(String anEncodedKey)
Set the blob name.
|
void |
setKey(String key)
Set the blob name.
|
void |
write(byte[] b)
Writes b.length bytes from the specified byte array to this output
stream.
|
void |
write(byte[] b,
int off,
int len)
Writes
len from the specified byte array starting at offset
off to the output stream. |
void |
write(int b)
Writes the specified byte to this output stream.
|
flushpublic NativeAzureFsOutputStream(OutputStream out, String aKey, String anEncodedKey) throws IOException
IOException@InterfaceAudience.LimitedPrivate(value="HDFS") public OutputStream getOutStream()
public void hflush()
throws IOException
hflush in interface org.apache.hadoop.fs.SyncableIOExceptionpublic void hsync()
throws IOException
hsync in interface org.apache.hadoop.fs.SyncableIOExceptionpublic boolean hasCapability(String capability)
hasCapability in interface org.apache.hadoop.fs.StreamCapabilitiescapability - string to query the stream support for.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionpublic void write(int b)
throws IOException
write in class OutputStreamb - 32-bit integer of block of 4 bytesIOExceptionpublic void write(byte[] b)
throws IOException
write in class OutputStreamb - Block of bytes to be written to the output stream.IOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
len from the specified byte array starting at offset
off to the output stream. The general contract for write(b,
off, len) is that some of the bytes in the array b
are written to the output stream in order; element b[off]
is the first byte written and b[off+len-1] is the last
byte written by this operation.write in class OutputStreamb - Byte array to be written.off - Write this offset in stream.len - Number of bytes to be written.IOExceptionpublic String getKey()
public void setKey(String key)
key - Blob name.public String getEncodedKey()
public void setEncodedKey(String anEncodedKey)
anEncodedKey - Blob name.Copyright © 2008–2020 Apache Software Foundation. All rights reserved.