001 package org.apache.commons.ssl.util;
002
003 import java.io.ByteArrayInputStream;
004 import java.io.IOException;
005
006 public class ByteArrayReadLine extends ReadLine {
007
008 public ByteArrayReadLine(ByteArrayInputStream in) { super(in); }
009
010 public String next() { return next(1); }
011
012 public String next(int lines) {
013 try {
014 return super.next(lines);
015 } catch (IOException ioe) {
016 // impossible since we're using ByteArrayInputStream
017 throw new RuntimeException("impossible", ioe);
018 }
019 }
020
021 public byte[] nextAsBytes() { return nextAsBytes(1); }
022
023 public byte[] nextAsBytes(int lines) {
024 try {
025 return super.nextAsBytes(lines);
026 } catch (IOException ioe) {
027 // impossible since we're using ByteArrayInputStream
028 throw new RuntimeException("impossible", ioe);
029 }
030 }
031
032 }