public class EncryptedChannel extends Object implements ByteChannel
Constructor and Description |
---|
EncryptedChannel(ByteChannel delegate,
Cipher cipherIn,
Cipher cipherOut)
Create an encrypted byte channel.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
isOpen() |
int |
read(ByteBuffer dst) |
int |
write(ByteBuffer src) |
public EncryptedChannel(ByteChannel delegate, Cipher cipherIn, Cipher cipherOut)
delegate
- Delegate byte channelcipherIn
- Cipher for decrypting incoming datacipherOut
- Cipher for encrypting outgoing datapublic int read(ByteBuffer dst) throws IOException
read
in interface ReadableByteChannel
IOException
public int write(ByteBuffer src) throws IOException
write
in interface WritableByteChannel
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in interface Channel
IOException
Copyright © 2016–2021. All rights reserved.