Advertisement
Guest User

3.Потоци в Java

a guest
Apr 14th, 2016
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. Потоци в Java
  2. File – something (a resource) that stores information
  3. - Located on a storage device
  4. - Has name, size, extension and contents
  5. - Stores information as series of bytes
  6.  
  7. Two file types – text and binary
  8. Text files contain text information
  9. - Store text differently according to the encoding. E.g.:
  10. o in ASCII a character is represented by 1 byte,
  11. o in UTF8 a character is represented by 1-4 bytes
  12. Binary files – store raw sequence of bytes
  13. - can contain any data (images, sounds, multimedia, etc.)
  14. - not human-readable
  15.  
  16. Stream – the natural way to transfer data in the computer world
  17. Streams are ordered sequences of bytes – provide consecutive access to its elements
  18.  
  19.  
  20. По default повечето хард дискове четат по 4 kB наведнъж (на операция), така че 4 kB е оптималния вариант при четене на байтове
  21.  
  22. Different types of streams are available to access different data sources – file access, network access, memory streams and others
  23.  
  24. Base streams:
  25. FileStream – чете и пише във файлове
  26. MemoryStream – чете и пише в паметта
  27. NetworkStream – чете и пише по мрежата
  28.  
  29. Празните файлове и папки не заемат никава памет на твърдия диск. Заемат памет само във файловата система
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement