< prev index next >
src/java.base/share/classes/sun/security/util/HexDumpEncoder.java
Print this page
@@ -51,11 +51,11 @@
public class HexDumpEncoder {
private int offset;
private int thisLineLength;
private int currentByte;
- private byte thisLine[] = new byte[16];
+ private byte[] thisLine = new byte[16];
static void hexDigit(PrintStream p, byte x) {
char c;
c = (char) ((x >> 4) & 0xf);
@@ -91,11 +91,11 @@
pStream.print(": ");
currentByte = 0;
thisLineLength = len;
}
- protected void encodeAtom(OutputStream o, byte buf[], int off, int len) throws IOException {
+ protected void encodeAtom(OutputStream o, byte[] buf, int off, int len) throws IOException {
thisLine[currentByte] = buf[off];
hexDigit(pStream, buf[off]);
pStream.print(" ");
currentByte++;
if (currentByte == 8)
@@ -127,11 +127,11 @@
/**
* This method works around the bizarre semantics of BufferedInputStream's
* read method.
*/
- protected int readFully(InputStream in, byte buffer[])
+ protected int readFully(InputStream in, byte[] buffer)
throws java.io.IOException {
for (int i = 0; i < buffer.length; i++) {
int q = in.read();
if (q == -1)
return i;
@@ -149,11 +149,11 @@
public void encode(InputStream inStream, OutputStream outStream)
throws IOException
{
int j;
int numBytes;
- byte tmpbuffer[] = new byte[bytesPerLine()];
+ byte[] tmpbuffer = new byte[bytesPerLine()];
encodeBufferPrefix(outStream);
while (true) {
numBytes = readFully(inStream, tmpbuffer);
@@ -179,11 +179,11 @@
/**
* A 'streamless' version of encode that simply takes a buffer of
* bytes and returns a string containing the encoded buffer.
*/
- public String encode(byte aBuffer[]) {
+ public String encode(byte[] aBuffer) {
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
ByteArrayInputStream inStream = new ByteArrayInputStream(aBuffer);
String retVal = null;
try {
encode(inStream, outStream);
@@ -262,11 +262,11 @@
public void encodeBuffer(InputStream inStream, OutputStream outStream)
throws IOException
{
int j;
int numBytes;
- byte tmpbuffer[] = new byte[bytesPerLine()];
+ byte[] tmpbuffer = new byte[bytesPerLine()];
encodeBufferPrefix(outStream);
while (true) {
numBytes = readFully(inStream, tmpbuffer);
@@ -290,22 +290,22 @@
/**
* Encode the buffer in <i>aBuffer</i> and write the encoded
* result to the OutputStream <i>aStream</i>.
*/
- public void encodeBuffer(byte aBuffer[], OutputStream aStream)
+ public void encodeBuffer(byte[] aBuffer, OutputStream aStream)
throws IOException
{
ByteArrayInputStream inStream = new ByteArrayInputStream(aBuffer);
encodeBuffer(inStream, aStream);
}
/**
* A 'streamless' version of encode that simply takes a buffer of
* bytes and returns a string containing the encoded buffer.
*/
- public String encodeBuffer(byte aBuffer[]) {
+ public String encodeBuffer(byte[] aBuffer) {
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
ByteArrayInputStream inStream = new ByteArrayInputStream(aBuffer);
try {
encodeBuffer(inStream, outStream);
} catch (Exception IOException) {
< prev index next >