Java ByteBuffer Decode decodeIO(String encoding, ByteBuffer bbuf)

Here you can find the source of decodeIO(String encoding, ByteBuffer bbuf)

Description

decode IO

License

Apache License

Declaration

private static String decodeIO(String encoding, ByteBuffer bbuf) throws UnsupportedEncodingException 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.*;
import java.nio.ByteBuffer;

public class Main {
    private static String decodeIO(String encoding, ByteBuffer bbuf) throws UnsupportedEncodingException {
        if (bbuf.hasArray())
            return new String(bbuf.array(), encoding);

        throw new IllegalArgumentException();
    }/*  ww  w  .  j av a 2 s  .  c om*/
}

Related

  1. decodeAlign(ByteBuffer buf)
  2. decodeASCII(ByteBuffer buffer, int length, int offset)
  3. decodeBuffer(ByteBuffer buffer, String charsetName)
  4. decodeDouble(ByteBuffer bb)
  5. decodeInt(ByteBuffer buffer, int start)
  6. decodeLength(ByteBuffer buf)
  7. decodeLong(ByteBuffer buffer, int start)
  8. decodeNIO(String encoding, ByteBuffer bbuf)
  9. decodeNumber(byte firstByte, ByteBuffer buffer)