IO commonly used in Java IO operation class inheritance structure analysis
- 2020-04-01 01:45:06
- OfStack
IO commonly USES IO operation class inheritance structure
IO Characters of the flow Reader (source) BufferedReader LineNumberReader InputStreamReader FileReader(bridge from byte flow to character flow) StringReader Writer (purpose) BufferedWriter OutputStreamWriter FileWriter(bridge of character flow to byte stream) StringWriter empty PrintWriter empty Byte stream InputStream (source) FileInputStream empty SequenceInputStream Combined flow ByteArrayInputStream At construction time, the data source needs to be received, and the data source is a byte array. OutputStream (purpose) FileOutputStream empty ByteArrayOutputStream Internally defined variable length byte array, it is the data destination;
IO Characters of the flow Reader (source) BufferedReader LineNumberReader InputStreamReader FileReader(bridge from byte flow to character flow) StringReader Writer (purpose) BufferedWriter OutputStreamWriter FileWriter(bridge of character flow to byte stream) StringWriter empty PrintWriter empty Byte stream InputStream (source) FileInputStream empty SequenceInputStream Combined flow ByteArrayInputStream At construction time, the data source needs to be received, and the data source is a byte array. OutputStream (purpose) FileOutputStream empty ByteArrayOutputStream Internally defined variable length byte array, it is the data destination;