| | |
| | | */ |
| | | package org.opends.server.protocols.asn1; |
| | | |
| | | import org.opends.server.types.ByteSequence; |
| | | |
| | | import java.io.IOException; |
| | | import java.io.OutputStream; |
| | | import java.nio.ByteBuffer; |
| | | import java.nio.channels.WritableByteChannel; |
| | | import java.io.OutputStream; |
| | | import java.io.IOException; |
| | | import java.util.concurrent.locks.ReentrantLock; |
| | | |
| | | import org.opends.server.types.ByteSequence; |
| | | |
| | | /** |
| | | * This class is for writing ASN.1 elements directly to an |
| | | * NIO WritableByteChannel with an embedded ByteBuffer. |
| | |
| | | { |
| | | flushLock.lock(); |
| | | } |
| | | while(byteBuffer.hasRemaining()) |
| | | { |
| | | byteChannel.write(byteBuffer); |
| | | } |
| | | byteChannel.write(byteBuffer); |
| | | } |
| | | finally |
| | | { |