|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.io.InputStream
|
+--java.io.DataInputStream
바이트 정보를 읽어서 다른 타입의 정보로 변환할 수 있도록 만든 입력스트림 클래스.
| Field Summary | |
protected InputStream |
in
실제 바이트 정보를 읽어올 입력 스트림. |
| Constructor Summary | |
DataInputStream(InputStream in)
새로운 객체를 만든다. |
|
| Method Summary | |
int |
available()
입력 스트림에서 읽을 수 있는 정보량을 구한다. |
void |
close()
입력 스트림을 닫는다. |
void |
mark(int readlimit)
입력 스트림에 mark정보를 설정한다. |
boolean |
markSupported()
입력 스트림이 mark기능을 지원하는지 여부를 구한다. |
int |
read()
한 바이트를 읽는다. |
int |
read(byte[] b)
바이트 배열로 읽어 들인다. |
int |
read(byte[] b,
int off,
int len)
바이트 배열 일부분으로 읽어 들인다. |
boolean |
readBoolean()
입력 스트림에서 한 바이트를 읽은 뒤 0이 아니면 true 0이면 false를 리턴한다. |
byte |
readByte()
입력 스트림에서 한 바이트를 읽는다. |
char |
readChar()
입력 스트림에서 char형 정보를 읽는다. |
double |
readDouble()
|
float |
readFloat()
|
void |
readFully(byte[] b)
바이트 배열로 읽어 들인다. read와 다른 점은 바이트 배열이 다 차기 전에 입력받을 정보가 없어지면 EOFException을 발생한다는 점이다. |
void |
readFully(byte[] b,
int off,
int len)
바이트 배열 일부분으로 읽어 들인다. read와 다른 점은 원하는 양만큼 읽기 전에 입력받을 정보가 없어지면 EOFException을 발생한다는 점이다. |
int |
readInt()
입력 스트림에서 정수형 정보를 읽는다. |
long |
readLong()
입력 스트림에서 Long형 정보를 읽는다. |
short |
readShort()
입력 스트림에서 두 바이트를 읽는다. |
int |
readUnsignedByte()
입력 스트림에서 한 바이트를 읽고 unsigned 바이트로 처리해 정수형 정보로 변환 후 리턴한다. |
int |
readUnsignedShort()
입력 스트림에서 두 바이트를 읽고 unsigned short로 처리해 정수형 정보로 변환 후 리턴한다. |
String |
readUTF()
입력 스트림에서 UTF형식 정보를 읽어 문자열을 만들어 리턴한다. |
static String |
readUTF(DataInput in)
특정 입력 스트림에서 UTF형식 정보를 읽어 문자열을 만들어 리턴한다. |
void |
reset()
입력 스트림의 읽는 위치를 mark정보에 설정된 위치로 변경한다. |
long |
skip(long n)
입력 스트림에서 정보를 읽지 않고 건너뛴다. |
int |
skipBytes(int n)
입력 스트림에서 정보를 읽지 않고 건너뛴다. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected InputStream in
| Constructor Detail |
public DataInputStream(InputStream in)
in - 실제 바이트 정보를 읽어올 입력 스트림.| Method Detail |
public int read()
throws IOException
read in class InputStreamIOException -
public final int read(byte[] b)
throws IOException
read in class InputStreamb - 읽은 정보가 저장될 바이트 배열.IOException -
public final int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamb - 읽은 정보가 저장될 바이트 배열.off - b에서 저장을 시작할 위치.len - 읽을 바이트 수.IOException -
public final void readFully(byte[] b)
throws IOException
readFully in interface DataInputb - 읽은 정보가 저장될 바이트 배열.IOException - EOFException - 읽을 량을 채우지 못할 발생.
public final void readFully(byte[] b,
int off,
int len)
throws IOException
readFully in interface DataInputb - 읽은 정보가 저장될 바이트 배열.off - b에서 저장을 시작할 위치.len - 읽을 바이트 수.EOFException - 읽을 량을 채우지 못할 발생.IOException -
public final int skipBytes(int n)
throws IOException
skipBytes in interface DataInputn - 건너 뛸 갯수.IOException - public void mark(int readlimit)
mark in class InputStream
public void reset()
throws IOException
reset in class InputStreamIOException - public boolean markSupported()
markSupported in class InputStream
public final boolean readBoolean()
throws IOException
readBoolean in interface DataInputIOException -
public final byte readByte()
throws IOException
readByte in interface DataInputIOException -
public final int readUnsignedByte()
throws IOException
readUnsignedByte in interface DataInputIOException -
public final char readChar()
throws IOException
readChar in interface DataInputIOException - EOFException - 2바이트를 읽을 수 없을 때 발생.
public final short readShort()
throws IOException
readShort in interface DataInputIOException - EOFException - 2바이트를 읽을 수 없을 때 발생.
public final int readUnsignedShort()
throws IOException
readUnsignedShort in interface DataInputIOException - EOFException - 2바이트를 읽을 수 없을 때 발생.
public final int readInt()
throws IOException
readInt in interface DataInputIOException - EOFException - 4바이트를 읽을 수 없을 때 발생.
public final long readLong()
throws IOException
readLong in interface DataInputIOException - EOFException - 8바이트를 읽을 수 없을 때 발생.
public final float readFloat()
throws IOException
readFloat in interface DataInput
public final double readDouble()
throws IOException
readDouble in interface DataInput
public final String readUTF()
throws IOException
readUTF in interface DataInputIOException -
public static final String readUTF(DataInput in)
throws IOException
in - UTF형식 정보를 읽어들일 입력 스트림.IOException -
public int available()
throws IOException
taInput.html#readUTF()">readUTF in interface DataInput