Uses of Class
java.nio.ByteBuffer
Packages that useByteBuffer Package Description com.sun.nio.sctp A Java API for Stream Control Transport Protocol.java.lang Provides classes that are fundamental to the design of the Java programming language.java.lang.module Classes to support module descriptors and creating configurations of modules by means of resolution and service binding.java.net.http HTTP Client and WebSocket APIsjava.nio Defines buffers, which are containers for data, and provides an overview of the other NIO packages.java.nio.channels Defines channels, which represent connections to entities that are capable of performing I/O operations, such as files and sockets; defines selectors, for multiplexed, non-blocking I/O operations.java.nio.charset Defines charsets, decoders, and encoders, for translating between bytes and Unicode characters.java.nio.file.attribute Interfaces and classes providing access to file and file system attributes.java.security Provides the classes and interfaces for the security framework.java.util Contains the collections framework, some internationalization support classes, a service loader, properties, random number generation, string parsing and scanning classes, base64 encoding and decoding, a bit array, and several miscellaneous utility classes.java.util.zip Provides classes for reading and writing the standard ZIP and GZIP file formats.javax.crypto Provides the classes and interfaces for cryptographic operations.javax.net.ssl Provides classes for the secure socket package.javax.smartcardio Java™ Smart Card I/O APIjdk.nashorn.api.scripting This package provides thejavax.scriptintegration, which is the preferred way to use Nashorn.Uses ofByteBuffer incom.sun.nio.sctp
Methods incom.sun.nio.sctp that returnByteBuffer Modifier and Type Method Description abstractByteBufferSendFailedNotification. buffer()Returns the data that was to be sent.Methods incom.sun.nio.sctp with parameters of typeByteBuffer Modifier and Type Method Description abstract <T> MessageInfoSctpChannel. receive(ByteBuffer dst, T attachment,NotificationHandler<T> handler)Receives a message into the given buffer and/or handles a notification.abstract <T> MessageInfoSctpMultiChannel. receive(ByteBuffer buffer, T attachment,NotificationHandler<T> handler)Receives a message and/or handles a notification via this channel.abstract intSctpChannel. send(ByteBuffer src,MessageInfo messageInfo)Sends a message via this channel.abstract intSctpMultiChannel. send(ByteBuffer buffer,MessageInfo messageInfo)Sends a message via this channel.Uses ofByteBuffer injava.lang
Methods injava.lang with parameters of typeByteBuffer Modifier and Type Method Description protectedClass<?>ClassLoader. defineClass(String name,ByteBuffer b,ProtectionDomain protectionDomain)Uses ofByteBuffer injava.lang.module
Methods injava.lang.module that return types with arguments of typeByteBuffer Modifier and Type Method Description defaultOptional<ByteBuffer>ModuleReader. read(String name)Reads a resource, returning a byte buffer with the contents of the resource.Methods injava.lang.module with parameters of typeByteBuffer Modifier and Type Method Description staticModuleDescriptorModuleDescriptor. read(ByteBuffer bb)Reads the binary form of a module declaration from a byte buffer as a module descriptor.staticModuleDescriptorModuleDescriptor. read(ByteBuffer bb,Supplier<Set<String>> packageFinder)Reads the binary form of a module declaration from a byte buffer as a module descriptor.default voidModuleReader. release(ByteBuffer bb)Release a byte buffer.Uses ofByteBuffer injava.net.http
Methods injava.net.http with type parameters of typeByteBuffer Modifier and Type Method Description static <S extendsFlow.Subscriber<? superList<ByteBuffer>>,T>
HttpResponse.BodyHandler<T>HttpResponse.BodyHandlers. fromSubscriber(S subscriber,Function<? super S,? extends T> finisher)Returns a response body handler that returns aBodySubscriber<T>obtained fromHttpResponse.BodySubscribers.fromSubscriber(Subscriber, Function), with the givensubscriberandfinisherfunction.static <S extendsFlow.Subscriber<? superList<ByteBuffer>>,T>
HttpResponse.BodySubscriber<T>HttpResponse.BodySubscribers. fromSubscriber(S subscriber,Function<? super S,? extends T> finisher)Returns a body subscriber that forwards all response body to the givenFlow.Subscriber.Methods injava.net.http that return types with arguments of typeByteBuffer Modifier and Type Method Description staticHttpResponse.BodyHandler<Flow.Publisher<List<ByteBuffer>>>HttpResponse.BodyHandlers. ofPublisher()Returns aBodyHandler<Publisher<List<ByteBuffer>>>that creates aBodySubscriber<Publisher<List<ByteBuffer>>>obtained fromBodySubscribers.ofPublisher().staticHttpResponse.BodySubscriber<Flow.Publisher<List<ByteBuffer>>>HttpResponse.BodySubscribers. ofPublisher()Returns a response subscriber which publishes the response body through aPublisher<List<ByteBuffer>>.Methods injava.net.http with parameters of typeByteBuffer Modifier and Type Method Description defaultCompletionStage<?>WebSocket.Listener. onBinary(WebSocket webSocket,ByteBuffer data, boolean last)A binary data has been received.defaultCompletionStage<?>WebSocket.Listener. onPing(WebSocket webSocket,ByteBuffer message)A Ping message has been received.defaultCompletionStage<?>WebSocket.Listener. onPong(WebSocket webSocket,ByteBuffer message)A Pong message has been received.CompletableFuture<WebSocket>WebSocket. sendBinary(ByteBuffer data, boolean last)Sends binary data with bytes from the given buffer.CompletableFuture<WebSocket>WebSocket. sendPing(ByteBuffer message)Sends a Ping message with bytes from the given buffer.CompletableFuture<WebSocket>WebSocket. sendPong(ByteBuffer message)Sends a Pong message with bytes from the given buffer.Method parameters injava.net.http with type arguments of typeByteBuffer Modifier and Type Method Description staticHttpRequest.BodyPublisherHttpRequest.BodyPublishers. fromPublisher(Flow.Publisher<? extendsByteBuffer> publisher)Returns a request body publisher whose body is retrieved from the givenFlow.Publisher.staticHttpRequest.BodyPublisherHttpRequest.BodyPublishers. fromPublisher(Flow.Publisher<? extendsByteBuffer> publisher, long contentLength)Returns a request body publisher whose body is retrieved from the givenFlow.Publisher.staticHttpResponse.BodyHandler<Void>HttpResponse.BodyHandlers. fromSubscriber(Flow.Subscriber<? superList<ByteBuffer>> subscriber)Returns a response body handler that returns aBodySubscriber<Void>obtained fromHttpResponse.BodySubscribers.fromSubscriber(Subscriber), with the givensubscriber.staticHttpResponse.BodySubscriber<Void>HttpResponse.BodySubscribers. fromSubscriber(Flow.Subscriber<? superList<ByteBuffer>> subscriber)Returns a body subscriber that forwards all response body to the givenFlow.Subscriber.Uses ofByteBuffer injava.nio
Subclasses ofByteBuffer injava.nio Modifier and Type Class Description classMappedByteBufferA direct byte buffer whose content is a memory-mapped region of a file.Methods injava.nio that returnByteBuffer Modifier and Type Method Description ByteBufferByteBuffer. alignedSlice(int unitSize)Creates a new byte buffer whose content is a shared and aligned subsequence of this buffer's content.staticByteBufferByteBuffer. allocate(int capacity)Allocates a new byte buffer.staticByteBufferByteBuffer. allocateDirect(int capacity)Allocates a new direct byte buffer.abstractByteBufferByteBuffer. asReadOnlyBuffer()Creates a new, read-only byte buffer that shares this buffer's content.abstractByteBufferByteBuffer. compact()Compacts this buffer (optional operation).abstractByteBufferByteBuffer. duplicate()Creates a new byte buffer that shares this buffer's content.ByteBufferByteBuffer. get(byte[] dst)Relative bulkget method.ByteBufferByteBuffer. get(byte[] dst, int offset, int length)Relative bulkget method.ByteBufferByteBuffer. order(ByteOrder bo)Modifies this buffer's byte order.abstractByteBufferByteBuffer. put(byte b)Relativeput method (optional operation).ByteBufferByteBuffer. put(byte[] src)Relative bulkput method (optional operation).ByteBufferByteBuffer. put(byte[] src, int offset, int length)Relative bulkput method (optional operation).abstractByteBufferByteBuffer. put(int index, byte b)Absoluteput method (optional operation).ByteBufferByteBuffer. put(ByteBuffer src)Relative bulkput method (optional operation).abstractByteBufferByteBuffer. putChar(char value)Relativeput method for writing a char value (optional operation).abstractByteBufferByteBuffer. putChar(int index, char value)Absoluteput method for writing a char value (optional operation).abstractByteBufferByteBuffer. putDouble(double value)Relativeput method for writing a double value (optional operation).abstractByteBufferByteBuffer. putDouble(int index, double value)Absoluteput method for writing a double value (optional operation).abstractByteBufferByteBuffer. putFloat(float value)Relativeput method for writing a float value (optional operation).abstractByteBufferByteBuffer. putFloat(int index, float value)Absoluteput method for writing a float value (optional operation).abstractByteBufferByteBuffer. putInt(int value)Relativeput method for writing an int value (optional operation).abstractByteBufferByteBuffer. putInt(int index, int value)Absoluteput method for writing an int value (optional operation).abstractByteBufferByteBuffer. putLong(int index, long value)Absoluteput method for writing a long value (optional operation).abstractByteBufferByteBuffer. putLong(long value)Relativeput method for writing a long value (optional operation).abstractByteBufferByteBuffer. putShort(int index, short value)Absoluteput method for writing a short value (optional operation).abstractByteBufferByteBuffer. putShort(short value)Relativeput method for writing a short value (optional operation).abstractByteBufferByteBuffer. slice()Creates a new byte buffer whose content is a shared subsequence of this buffer's content.staticByteBufferByteBuffer. wrap(byte[] array)Wraps a byte array into a buffer.staticByteBufferByteBuffer. wrap(byte[] array, int offset, int length)Wraps a byte array into a buffer.Methods injava.nio with parameters of typeByteBuffer Modifier and Type Method Description intByteBuffer. compareTo(ByteBuffer that)Compares this buffer to another.intByteBuffer. mismatch(ByteBuffer that)Finds and returns the relative index of the first mismatch between this buffer and a given buffer.ByteBufferByteBuffer. put(ByteBuffer src)Relative bulkput method (optional operation).Uses ofByteBuffer injava.nio.channels
Methods injava.nio.channels with parameters of typeByteBuffer Modifier and Type Method Description Future<Integer>AsynchronousByteChannel. read(ByteBuffer dst)Reads a sequence of bytes from this channel into the given buffer.<A> voidAsynchronousByteChannel. read(ByteBuffer dst, A attachment,CompletionHandler<Integer,? super A> handler)Reads a sequence of bytes from this channel into the given buffer.abstractFuture<Integer>AsynchronousFileChannel. read(ByteBuffer dst, long position)Reads a sequence of bytes from this channel into the given buffer, starting at the given file position.abstract <A> voidAsynchronousFileChannel. read(ByteBuffer dst, long position, A attachment,CompletionHandler<Integer,? super A> handler)Reads a sequence of bytes from this channel into the given buffer, starting at the given file position.abstractFuture<Integer>AsynchronousSocketChannel. read(ByteBuffer dst)abstract <A> voidAsynchronousSocketChannel. read(ByteBuffer[] dsts, int offset, int length, long timeout,TimeUnit unit, A attachment,CompletionHandler<Long,? super A> handler)Reads a sequence of bytes from this channel into a subsequence of the given buffers.abstract <A> voidAsynchronousSocketChannel. read(ByteBuffer dst, long timeout,TimeUnit unit, A attachment,CompletionHandler<Integer,? super A> handler)Reads a sequence of bytes from this channel into the given buffer.<A> voidAsynchronousSocketChannel. read(ByteBuffer dst, A attachment,CompletionHandler<Integer,? super A> handler)abstract intDatagramChannel. read(ByteBuffer dst)Reads a datagram from this channel.longDatagramChannel. read(ByteBuffer[] dsts)Reads a datagram from this channel.abstract longDatagramChannel. read(ByteBuffer[] dsts, int offset, int length)Reads a datagram from this channel.abstract intFileChannel. read(ByteBuffer dst)Reads a sequence of bytes from this channel into the given buffer.longFileChannel. read(ByteBuffer[] dsts)Reads a sequence of bytes from this channel into the given buffers.abstract longFileChannel. read(ByteBuffer[] dsts, int offset, int length)Reads a sequence of bytes from this channel into a subsequence of the given buffers.abstract intFileChannel. read(ByteBuffer dst, long position)Reads a sequence of bytes from this channel into the given buffer, starting at the given file position.intReadableByteChannel. read(ByteBuffer dst)Reads a sequence of bytes from this channel into the given buffer.longScatteringByteChannel. read(ByteBuffer[] dsts)Reads a sequence of bytes from this channel into the given buffers.longScatteringByteChannel. read(ByteBuffer[] dsts, int offset, int length)Reads a sequence of bytes from this channel into a subsequence of the given buffers.intSeekableByteChannel. read(ByteBuffer dst)Reads a sequence of bytes from this channel into the given buffer.abstract intSocketChannel. read(ByteBuffer dst)longSocketChannel. read(ByteBuffer[] dsts)abstract longSocketChannel. read(ByteBuffer[] dsts, int offset, int length)abstractSocketAddressDatagramChannel. receive(ByteBuffer dst)Receives a datagram via this channel.abstract intDatagramChannel. send(ByteBuffer src,SocketAddress target)Sends a datagram via this channel.Future<Integer>AsynchronousByteChannel. write(ByteBuffer src)Writes a sequence of bytes to this channel from the given buffer.<A> voidAsynchronousByteChannel. write(ByteBuffer src, A attachment,CompletionHandler<Integer,? super A> handler)Writes a sequence of bytes to this channel from the given buffer.abstractFuture<Integer>AsynchronousFileChannel. write(ByteBuffer src, long position)Writes a sequence of bytes to this channel from the given buffer, starting at the given file position.abstract <A> voidAsynchronousFileChannel. write(ByteBuffer src, long position, A attachment,CompletionHandler<Integer,? super A> handler)Writes a sequence of bytes to this channel from the given buffer, starting at the given file position.abstractFuture<Integer>AsynchronousSocketChannel. write(ByteBuffer src)abstract <A> voidAsynchronousSocketChannel. write(ByteBuffer[] srcs, int offset, int length, long timeout,TimeUnit unit, A attachment,CompletionHandler<Long,? super A> handler)Writes a sequence of bytes to this channel from a subsequence of the given buffers.abstract <A> voidAsynchronousSocketChannel. write(ByteBuffer src, long timeout,TimeUnit unit, A attachment,CompletionHandler<Integer,? super A> handler)Writes a sequence of bytes to this channel from the given buffer.<A> voidAsynchronousSocketChannel. write(ByteBuffer src, A attachment,CompletionHandler<Integer,? super A> handler)abstract intDatagramChannel. write(ByteBuffer src)Writes a datagram to this channel.longDatagramChannel. write(ByteBuffer[] srcs)Writes a datagram to this channel.abstract longDatagramChannel. write(ByteBuffer[] srcs, int offset, int length)Writes a datagram to this channel.abstract intFileChannel. write(ByteBuffer src)Writes a sequence of bytes to this channel from the given buffer.longFileChannel. write(ByteBuffer[] srcs)Writes a sequence of bytes to this channel from the given buffers.abstract longFileChannel. write(ByteBuffer[] srcs, int offset, int length)Writes a sequence of bytes to this channel from a subsequence of the given buffers.abstract intFileChannel. write(ByteBuffer src, long position)Writes a sequence of bytes to this channel from the given buffer, starting at the given file position.longGatheringByteChannel. write(ByteBuffer[] srcs)Writes a sequence of bytes to this channel from the given buffers.longGatheringByteChannel. write(ByteBuffer[] srcs, int offset, int length)Writes a sequence of bytes to this channel from a subsequence of the given buffers.intSeekableByteChannel. write(ByteBuffer src)Writes a sequence of bytes to this channel from the given buffer.abstract intSocketChannel. write(ByteBuffer src)longSocketChannel. write(ByteBuffer[] srcs)abstract longSocketChannel. write(ByteBuffer[] srcs, int offset, int length)intWritableByteChannel. write(ByteBuffer src)Writes a sequence of bytes to this channel from the given buffer.Uses ofByteBuffer injava.nio.charset
Methods injava.nio.charset that returnByteBuffer Modifier and Type Method Description ByteBufferCharset. encode(String str)Convenience method that encodes a string into bytes in this charset.ByteBufferCharset. encode(CharBuffer cb)Convenience method that encodes Unicode characters into bytes in this charset.ByteBufferCharsetEncoder. encode(CharBuffer in)Convenience method that encodes the remaining content of a single input character buffer into a newly-allocated byte buffer.Methods injava.nio.charset with parameters of typeByteBuffer Modifier and Type Method Description CharBufferCharset. decode(ByteBuffer bb)Convenience method that decodes bytes in this charset into Unicode characters.CharBufferCharsetDecoder. decode(ByteBuffer in)Convenience method that decodes the remaining content of a single input byte buffer into a newly-allocated character buffer.CoderResultCharsetDecoder. decode(ByteBuffer in,CharBuffer out, boolean endOfInput)Decodes as many bytes as possible from the given input buffer, writing the results to the given output buffer.protected abstractCoderResultCharsetDecoder. decodeLoop(ByteBuffer in,CharBuffer out)Decodes one or more bytes into one or more characters.CoderResultCharsetEncoder. encode(CharBuffer in,ByteBuffer out, boolean endOfInput)Encodes as many characters as possible from the given input buffer, writing the results to the given output buffer.protected abstractCoderResultCharsetEncoder. encodeLoop(CharBuffer in,ByteBuffer out)Encodes one or more characters into one or more bytes.CoderResultCharsetEncoder. flush(ByteBuffer out)Flushes this encoder.protectedCoderResultCharsetEncoder. implFlush(ByteBuffer out)Flushes this encoder.Uses ofByteBuffer injava.nio.file.attribute
Methods injava.nio.file.attribute with parameters of typeByteBuffer Modifier and Type Method Description intUserDefinedFileAttributeView. read(String name,ByteBuffer dst)Read the value of a user-defined attribute into a buffer.intUserDefinedFileAttributeView. write(String name,ByteBuffer src)Writes the value of a user-defined attribute from a buffer.Uses ofByteBuffer injava.security
Methods injava.security with parameters of typeByteBuffer Modifier and Type Method Description protectedClass<?>SecureClassLoader. defineClass(String name,ByteBuffer b,CodeSource cs)Converts aByteBufferinto an instance of classClass, with an optional CodeSource.protected voidMessageDigestSpi. engineUpdate(ByteBuffer input)Update the digest using the specified ByteBuffer.protected voidSignatureSpi. engineUpdate(ByteBuffer input)Updates the data to be signed or verified using the specified ByteBuffer.voidMessageDigest. update(ByteBuffer input)Update the digest using the specified ByteBuffer.voidSignature. update(ByteBuffer data)Updates the data to be signed or verified using the specified ByteBuffer.Uses ofByteBuffer injava.util
Methods injava.util that returnByteBuffer Modifier and Type Method Description ByteBufferBase64.Decoder. decode(ByteBuffer buffer)Decodes all bytes from the input byte buffer using theBase64encoding scheme, writing the results into a newly-allocated ByteBuffer.ByteBufferBase64.Encoder. encode(ByteBuffer buffer)Encodes all remaining bytes from the specified byte buffer into a newly-allocated ByteBuffer using theBase64encoding scheme.Methods injava.util with parameters of typeByteBuffer Modifier and Type Method Description ByteBufferBase64.Decoder. decode(ByteBuffer buffer)Decodes all bytes from the input byte buffer using theBase64encoding scheme, writing the results into a newly-allocated ByteBuffer.ByteBufferBase64.Encoder. encode(ByteBuffer buffer)Encodes all remaining bytes from the specified byte buffer into a newly-allocated ByteBuffer using theBase64encoding scheme.staticBitSetBitSet. valueOf(ByteBuffer bb)Returns a new bit set containing all the bits in the given byte buffer between its position and limit.Uses ofByteBuffer injava.util.zip
Methods injava.util.zip with parameters of typeByteBuffer Modifier and Type Method Description intDeflater. deflate(ByteBuffer output)Compresses the input data and fills specified buffer with compressed data.intDeflater. deflate(ByteBuffer output, int flush)Compresses the input data and fills the specified buffer with compressed data.intInflater. inflate(ByteBuffer output)Uncompresses bytes into specified buffer.voidDeflater. setDictionary(ByteBuffer dictionary)Sets preset dictionary for compression.voidInflater. setDictionary(ByteBuffer dictionary)Sets the preset dictionary to the bytes in the given buffer.voidDeflater. setInput(ByteBuffer input)Sets input data for compression.voidInflater. setInput(ByteBuffer input)Sets input data for decompression.voidAdler32. update(ByteBuffer buffer)Updates the checksum with the bytes from the specified buffer.default voidChecksum. update(ByteBuffer buffer)Updates the current checksum with the bytes from the specified buffer.voidCRC32. update(ByteBuffer buffer)Updates the CRC-32 checksum with the bytes from the specified buffer.voidCRC32C. update(ByteBuffer buffer)Updates the CRC-32C checksum with the bytes from the specified buffer.Uses ofByteBuffer injavax.crypto
Methods injavax.crypto with parameters of typeByteBuffer Modifier and Type Method Description intCipher. doFinal(ByteBuffer input,ByteBuffer output)Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation.protected intCipherSpi. engineDoFinal(ByteBuffer input,ByteBuffer output)Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation.protected intCipherSpi. engineUpdate(ByteBuffer input,ByteBuffer output)Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.protected voidMacSpi. engineUpdate(ByteBuffer input)Processesinput.remaining()bytes in the ByteBufferinput, starting atinput.position().protected voidCipherSpi. engineUpdateAAD(ByteBuffer src)Continues a multi-part update of the Additional Authentication Data (AAD).intCipher. update(ByteBuffer input,ByteBuffer output)Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.voidMac. update(ByteBuffer input)Processesinput.remaining()bytes in the ByteBufferinput, starting atinput.position().voidCipher. updateAAD(ByteBuffer src)Continues a multi-part update of the Additional Authentication Data (AAD).Uses ofByteBuffer injavax.net.ssl
Methods injavax.net.ssl with parameters of typeByteBuffer Modifier and Type Method Description SSLEngineResultSSLEngine. unwrap(ByteBuffer src,ByteBuffer dst)Attempts to decode SSL/TLS/DTLS network data into a plaintext application data buffer.SSLEngineResultSSLEngine. unwrap(ByteBuffer src,ByteBuffer[] dsts)Attempts to decode SSL/TLS/DTLS network data into a sequence of plaintext application data buffers.abstractSSLEngineResultSSLEngine. unwrap(ByteBuffer src,ByteBuffer[] dsts, int offset, int length)Attempts to decode SSL/TLS/DTLS network data into a subsequence of plaintext application data buffers.abstractSSLEngineResultSSLEngine. wrap(ByteBuffer[] srcs, int offset, int length,ByteBuffer dst)Attempts to encode plaintext bytes from a subsequence of data buffers into SSL/TLS/DTLS network data.SSLEngineResultSSLEngine. wrap(ByteBuffer[] srcs,ByteBuffer dst)Attempts to encode plaintext bytes from a sequence of data buffers into SSL/TLS/DTLS network data.SSLEngineResultSSLEngine. wrap(ByteBuffer src,ByteBuffer dst)Attempts to encode a buffer of plaintext application data into SSL/TLS/DTLS network data.Uses ofByteBuffer injavax.smartcardio
Methods injavax.smartcardio with parameters of typeByteBuffer Modifier and Type Method Description abstract intCardChannel. transmit(ByteBuffer command,ByteBuffer response)Transmits the command APDU stored in the command ByteBuffer and receives the response APDU in the response ByteBuffer.Constructors injavax.smartcardio with parameters of typeByteBuffer Constructor Description CommandAPDU(ByteBuffer apdu)Creates a CommandAPDU from the ByteBuffer containing the complete APDU contents (header and body).Uses ofByteBuffer injdk.nashorn.api.scripting
Methods injdk.nashorn.api.scripting with parameters of typeByteBuffer Modifier and Type Method Description voidScriptObjectMirror. setIndexedPropertiesToExternalArrayData(ByteBuffer buf)Deprecated, for removal: This API element is subject to removal in a future version.Nashorn extension: setIndexedPropertiesToExternalArrayData.