Java ByteBuffer Put readByteVector8(ByteBuffer input)

Here you can find the source of readByteVector8(ByteBuffer input)

Description

read Byte Vector

License

Open Source License

Declaration

static String readByteVector8(ByteBuffer input) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;

public class Main {
    static String readByteVector8(ByteBuffer input) {
        int length = getInt8(input);
        byte[] data = new byte[length];
        input.get(data);//from   w  w w.j  a v a  2  s .  co m
        return new String(data, StandardCharsets.US_ASCII);
    }

    static int getInt8(ByteBuffer input) {
        return input.get();
    }
}

Related

  1. readAsByteBuffer(final InputStream source)
  2. readBER32(ByteBuffer input)
  3. readByteBuffer(DataInputStream is)
  4. readByteBufferList(DataInputStream is)
  5. readBytes(InputStream is, ByteBuffer buffer)
  6. readFully(InputStream in, ByteBuffer out)
  7. readFully(InputStream is, ByteBuffer buf)
  8. readFully(InputStream is, ByteBuffer buffer, int nrBytes)
  9. readInto(ByteBuffer buf, InputStream inputStream)