Java Dump Byte Array dumpBytesAsString(ByteArrayOutputStream baos)

Here you can find the source of dumpBytesAsString(ByteArrayOutputStream baos)

Description

dump Bytes As String

License

Apache License

Declaration

public static void dumpBytesAsString(ByteArrayOutputStream baos) 

Method Source Code

//package com.java2s;
/*/*from  ww  w  .java  2s  . c o  m*/
 * Copyright WSO2, Inc. (http://wso2.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import java.io.*;

public class Main {
    public static void dumpBytesAsString(ByteArrayOutputStream baos) {
        byte b[] = baos.toByteArray();
        for (byte i : b) {
            System.out.print((char) i);
        }
        System.out.println();
    }
}

Related

  1. dump(PrintStream printer, byte[] buffer, int offset, int count)
  2. dumpBuffer(final PrintStream out, final String label, final byte[] b)
  3. dumpByteArray(byte[] byteArray)
  4. dumpByteArray(byte[] bytes)
  5. dumpBytes(PrintStream printStream, byte bytes[])
  6. dumpBytesToFile(byte[] bytes, String outputFile)
  7. dumpClass(String file, byte[] bytes)
  8. dumpFileIntoByteArray(File f)
  9. dumpHex(byte[] data)