1 21 22 27 28 package com.sun.mail.iap; 29 30 import java.io.ByteArrayInputStream ; 31 32 39 40 public class ByteArray { 41 private byte[] bytes; private int start; private int count; 45 48 public ByteArray(byte[] b, int start, int count) { 49 bytes = b; 50 this.start = start; 51 this.count = count; 52 } 53 54 58 public byte[] getBytes() { 59 return bytes; 60 } 61 62 65 public byte[] getNewBytes() { 66 byte[] b = new byte[count]; 67 System.arraycopy(bytes, start, b, 0, count); 68 return b; 69 } 70 71 74 public int getStart() { 75 return start; 76 } 77 78 81 public int getCount() { 82 return count; 83 } 84 85 88 public ByteArrayInputStream toByteArrayInputStream() { 89 return new ByteArrayInputStream (bytes, start, count); 90 } 91 } 92 | Popular Tags |