Io package download






















A data output stream lets an application write primitive Java data types to an output stream in a portable way. Instances of the file descriptor class serve as an opaque handle to the underlying machine-specific structure representing an open file, an open socket, or another source or sink of bytes. A FileInputStream obtains input bytes from a file in a file system. A file output stream is an output stream for writing data to a File or to a FileDescriptor.

A FilterInputStream contains some other input stream, which it uses as its basic source of data, possibly transforming the data along the way or providing additional functionality. This abstract class is the superclass of all classes representing an input stream of bytes. An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes them into characters using a specified charset.

This class incorrectly assumes that bytes adequately represent characters. A utility class to set and get the system-wide filter or create a filter from a pattern string. Provide programmatic access to the persistent fields to be written to ObjectOutput. This abstract class is the superclass of all classes representing an output stream of bytes.

An OutputStreamWriter is a bridge from character streams to byte streams: Characters written to it are encoded into bytes using a specified charset. A piped input stream should be connected to a piped output stream; the piped input stream then provides whatever data bytes are written to the piped output stream.

A piped output stream can be connected to a piped input stream to create a communications pipe. A PrintStream adds functionality to another output stream, namely the ability to print representations of various data values conveniently. A PushbackInputStream adds functionality to another input stream, namely the ability to "push back" or "unread" bytes, by storing pushed-back bytes in an internal buffer.

A character-stream reader that allows characters to be pushed back into the stream. Instances of this class support both reading and writing to a random access file. A SequenceInputStream represents the logical concatenation of other input streams. Pipe creates a synchronous in-memory pipe. It can be used to connect code expecting an io. Reader with code expecting an io. Reads and Writes on the pipe are matched one to one except when multiple Reads are needed to consume a single Write.

That is, each Write to the PipeWriter blocks until it has satisfied one or more Reads from the PipeReader that fully consume the written data. The data is copied directly from the Write to the corresponding Read or Reads ; there is no internal buffering. It is safe to call Read and Write in parallel with each other or with Close. Parallel calls to Read and parallel calls to Write are also safe: the individual calls will be gated sequentially.

ReadAll reads from r until an error or EOF and returns the data it read. ReadAtLeast reads from r into buf until it has read at least min bytes. It returns the number of bytes copied and an error if fewer bytes were read.

The error is EOF only if no bytes were read. If r returns an error having read at least min bytes, the error is dropped. ReadFull reads exactly len buf bytes from r into buf. If r returns an error having read at least len buf bytes, the error is dropped. WriteString writes the contents of the string s to w, which accepts a slice of bytes. If w implements StringWriter, its WriteString method is invoked directly. Otherwise, w.

Write is called exactly once. ReadByte reads and returns the next byte from the input or any error encountered. If ReadByte returns an error, no input byte was consumed, and the returned byte value is undefined. ReadByte provides an efficient interface for byte-at-time processing. A Reader that does not implement ByteReader can be wrapped using bufio. NewReader to add this method. UnreadByte causes the next call to ReadByte to return the same byte as the previous call to ReadByte.

It may be an error to call UnreadByte twice without an intervening call to ReadByte. The behavior of Close after the first call is undefined. Specific implementations may document their own behavior. A LimitedReader reads from R but limits the amount of data returned to just N bytes. Each call to Read updates N to reflect the new amount remaining. Close closes the reader; subsequent writes to the write half of the pipe will return the error ErrClosedPipe.

CloseWithError closes the reader; subsequent writes to the write half of the pipe will return the error err. Read implements the standard Read interface: it reads data from the pipe, blocking until a writer arrives or the write end is closed. If the write end is closed with an error, that error is returned as err; otherwise err is EOF.

Package FileAccess. Package FileAccess, Boolean. CreatePart Uri, String. Creates a new part with a given URI, content type, and compression option. When overridden in a derived class, creates a new part in the package. DeletePart Uri. DeletePartCore Uri. DeleteRelationship String.

Dispose Boolean. Equals Object. Determines whether the specified object is equal to the current object. Inherited from Object. Saves the contents of all parts and relationships that are contained in the package. Serves as the default hash function. GetPart Uri. GetPartCore Uri. When overridden in a derived class, returns the part addressed by a given URI. When overridden in a derived class, returns an array of all the parts in the package.

GetRelationship String. GetRelationshipsByType String. Open Stream. If ReadByte returns an error, no input byte was consumed, and the returned byte value is undefined. ReadByte provides an efficient interface for byte-at-time processing. A Reader that does not implement ByteReader can be wrapped using bufio.

NewReader to add this method. UnreadByte causes the next call to ReadByte to return the same byte as the previous call to ReadByte. It may be an error to call UnreadByte twice without an intervening call to ReadByte. The behavior of Close after the first call is undefined.

Specific implementations may document their own behavior. A LimitedReader reads from R but limits the amount of data returned to just N bytes. Each call to Read updates N to reflect the new amount remaining. Close closes the reader; subsequent writes to the write half of the pipe will return the error ErrClosedPipe. CloseWithError closes the reader; subsequent writes to the write half of the pipe will return the error err. Read implements the standard Read interface: it reads data from the pipe, blocking until a writer arrives or the write end is closed.

If the write end is closed with an error, that error is returned as err; otherwise err is EOF. Close closes the writer; subsequent reads from the read half of the pipe will return no bytes and EOF.

CloseWithError closes the writer; subsequent reads from the read half of the pipe will return no bytes and the error err, or EOF if err is nil. Write implements the standard Write interface: it writes data to the pipe, blocking until one or more readers have consumed all the data or the read end is closed.

If the read end is closed with an error, that err is returned as err; otherwise err is ErrClosedPipe. Read reads up to len p bytes into p. If some data is available but not len p bytes, Read conventionally returns what is available instead of waiting for more.

The next Read should return 0, EOF. Callers should treat a return of 0 and nil as indicating that nothing happened; in particular it does not indicate EOF. MultiReader returns a Reader that's the logical concatenation of the provided input readers. They're read sequentially. If any of the readers return a non-nil, non-EOF error, Read will return that error.

TeeReader returns a Reader that writes to w what it reads from r. All reads from r performed through it are matched with corresponding writes to w.

There is no internal buffering - the write must complete before the read completes. Any error encountered while writing is reported as a read error. ReadAt reads len p bytes into p starting at offset off in the underlying input source. In this respect, ReadAt is stricter than Read. If some data is available but not len p bytes, ReadAt blocks until either all the data is available or an error occurs.

In this respect ReadAt is different from Read. If ReadAt is reading from an input source with a seek offset, ReadAt should not affect nor be affected by the underlying seek offset.



0コメント

  • 1000 / 1000