SlideShare a Scribd company logo
1 of 8
PRESENTED BY
EDWIN RAMIREZ
TERRY MENA
NILSA FUENTES
This is a general purpose language, concurrent,
class-based and object oriented language
becomes completely independent of the
platform and the both powerful. That
philosophy and his ability to create
applications for TCP / IP has made it one of
the most used languages ​​today.
RESOURCES
To write Java programs needed to do the precompiled and interpretation of the code,
are environments that allow the creation of the bytecodes and tools include ability to
run applications of all kinds, the most famous Manual Java Developer Kit (JDK) from
Sun, However, writing and compiling programs used and is a bit uncomfortable. So
many companies make their own editing environments such as Netbeans, Eclipse. etc
1. Provide the Java Communications API control over any of the
devices. Before using a device, the API must know.
2. Opening the device and put the line speed, parity, etc.. required.
3. Write or read some data using the protocol specified for the device. For
example, if you have to communicate with a printer, you can send the
codes start and end of work.
4. Close the port.
USING COMMUNICATIONS API
Enumeration listaPuertos = CommPortIdentifier.getPortIdentifiers();
CommPortIdentifier idPuerto = null;
boolean encontrado = false;
while (listaPuertos.hasMoreElements() && !encontrado) {
idPuerto = (CommPortIdentifier) listaPuertos.nextElement();
if (idPuerto.getPortType() == CommPortIdentifier.PORT_SERIAL) {
if (idPuerto.getName().equals("COM1")) {
encontrado = true;
INITIALIZATION API WITH SERIAL
Enumeration listaPuertos = CommPortIdentifier.getPortIdentifiers();
CommPortIdentifier idPuerto = null;
boolean encontrado = false;
while (listaPuertos.hasMoreElements() && !encontrado) {
idPuerto = (CommPortIdentifier) listaPuertos.nextElement();
if (idPuerto.getPortType() == CommPortIdentifier.PORT_SERIAL) {
if (idPuerto.getName().equals("COM1")) {
encontrado = true;
INITIALIZATION API WITH SERIAL
InputStream input = null;
OutputStream out;
SerialPort puertoSerie = null;
public ControlPuertoSerie (String device, int baud, int timeout) throws
Exception { CommPortIdentifier idPuerto =
CommPortIdentifier.getPortIdentifier (device);
puertoSerie = (SerialPort) idPuerto.openPort ("PuertoSerie", timeout);
puertoSerie.setSerialPortParams(9600SerialPort.DATABITS_8,SerialPort.STOP
BITS_1,SerialPort.PARITY_NONE);
puertoSerie.setFlowcontrolMode(SerialPort.FLOWCTRL_NONE);
puertoSerie.enableRcvThreshold(1);
puertoSerie.enableRcvTimeout(timeout);
System.out.println ("Open Serial Device");
puertoSerie.getOutputStream out = ();
puertoSerie.getInputStream input = ();
OPENING AND CONDITIONING DEVICES
To write, you can do:
try { salida.write (arraySalida, 0, length);
And for reading data, you only have to do:
try { int b = entrada.read ()
CLOSING PORTS
try { entrada.close ();
output.close (); }
WRITING AND READING DATA

More Related Content

What's hot

Final requirement for programming-Bonifacio, Mary Clemence
Final requirement for programming-Bonifacio, Mary ClemenceFinal requirement for programming-Bonifacio, Mary Clemence
Final requirement for programming-Bonifacio, Mary Clemenceclemencebonifacio
 
Programming with \'C\'
Programming with \'C\'Programming with \'C\'
Programming with \'C\'bdmsts
 
Computer programming tools and building process
Computer programming tools and building processComputer programming tools and building process
Computer programming tools and building processArghodeepPaul
 
Programming Methodology
Programming MethodologyProgramming Methodology
Programming Methodologyarchikabhatia
 
Error Detection & Recovery
Error Detection & RecoveryError Detection & Recovery
Error Detection & RecoveryAkhil Kaushik
 
Theory of programming
Theory of programmingTheory of programming
Theory of programmingtcc_joemarie
 
Mark asoi ppt
Mark asoi pptMark asoi ppt
Mark asoi pptmark-asoi
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languagesVarun Garg
 
Tips for Happier Python Debugging
Tips for Happier Python DebuggingTips for Happier Python Debugging
Tips for Happier Python DebuggingChun-Hao Chang
 
Welcome to the .Net
Welcome to the .NetWelcome to the .Net
Welcome to the .NetAmr Shawky
 
What's coming to c# (Tel-Aviv, 2018)
What's coming to c# (Tel-Aviv, 2018)What's coming to c# (Tel-Aviv, 2018)
What's coming to c# (Tel-Aviv, 2018)Moaid Hathot
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythonRanjith kumar
 
Best Practices in apps development with Titanium Appcelerator
Best Practices in apps development with Titanium Appcelerator Best Practices in apps development with Titanium Appcelerator
Best Practices in apps development with Titanium Appcelerator Alessio Ricco
 
Computer languages
Computer languagesComputer languages
Computer languagesPrince Arsal
 

What's hot (20)

Types of errors 2019
Types of errors 2019Types of errors 2019
Types of errors 2019
 
Swift Introduction
Swift IntroductionSwift Introduction
Swift Introduction
 
Final requirement for programming-Bonifacio, Mary Clemence
Final requirement for programming-Bonifacio, Mary ClemenceFinal requirement for programming-Bonifacio, Mary Clemence
Final requirement for programming-Bonifacio, Mary Clemence
 
Programming with \'C\'
Programming with \'C\'Programming with \'C\'
Programming with \'C\'
 
Computer programming tools and building process
Computer programming tools and building processComputer programming tools and building process
Computer programming tools and building process
 
Programming Methodology
Programming MethodologyProgramming Methodology
Programming Methodology
 
Error Detection & Recovery
Error Detection & RecoveryError Detection & Recovery
Error Detection & Recovery
 
Intro cpp
Intro cppIntro cpp
Intro cpp
 
Theory of programming
Theory of programmingTheory of programming
Theory of programming
 
Mark asoi ppt
Mark asoi pptMark asoi ppt
Mark asoi ppt
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languages
 
Tips for Happier Python Debugging
Tips for Happier Python DebuggingTips for Happier Python Debugging
Tips for Happier Python Debugging
 
Project two c++ tutorial
Project two c++ tutorialProject two c++ tutorial
Project two c++ tutorial
 
Welcome to the .Net
Welcome to the .NetWelcome to the .Net
Welcome to the .Net
 
What's coming to c# (Tel-Aviv, 2018)
What's coming to c# (Tel-Aviv, 2018)What's coming to c# (Tel-Aviv, 2018)
What's coming to c# (Tel-Aviv, 2018)
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Switch case looping
Switch case loopingSwitch case looping
Switch case looping
 
Best Practices in apps development with Titanium Appcelerator
Best Practices in apps development with Titanium Appcelerator Best Practices in apps development with Titanium Appcelerator
Best Practices in apps development with Titanium Appcelerator
 
Computer languages
Computer languagesComputer languages
Computer languages
 
Introduction to programming languages part 1
Introduction to programming languages   part 1Introduction to programming languages   part 1
Introduction to programming languages part 1
 

Viewers also liked

Drug research beyond imagination
Drug research   beyond imaginationDrug research   beyond imagination
Drug research beyond imaginationBambang Priyambodo
 
งานนำเสนอ1
งานนำเสนอ1งานนำเสนอ1
งานนำเสนอ1jarintorn
 
Peraturan Kepala Badan POM tentang sertifikasi CPOB
Peraturan Kepala Badan POM tentang sertifikasi  CPOBPeraturan Kepala Badan POM tentang sertifikasi  CPOB
Peraturan Kepala Badan POM tentang sertifikasi CPOBBambang Priyambodo
 
Peraturan Kepala Badan POM tentang obat wajib uji ekivalen
Peraturan Kepala Badan POM tentang obat wajib uji ekivalenPeraturan Kepala Badan POM tentang obat wajib uji ekivalen
Peraturan Kepala Badan POM tentang obat wajib uji ekivalenBambang Priyambodo
 

Viewers also liked (7)

Drug research beyond imagination
Drug research   beyond imaginationDrug research   beyond imagination
Drug research beyond imagination
 
Media pharmaindonesiaii 2011
Media pharmaindonesiaii 2011Media pharmaindonesiaii 2011
Media pharmaindonesiaii 2011
 
Petunjuk tehnik cpotb
Petunjuk tehnik cpotbPetunjuk tehnik cpotb
Petunjuk tehnik cpotb
 
งานนำเสนอ1
งานนำเสนอ1งานนำเสนอ1
งานนำเสนอ1
 
Peraturan Kepala Badan POM tentang sertifikasi CPOB
Peraturan Kepala Badan POM tentang sertifikasi  CPOBPeraturan Kepala Badan POM tentang sertifikasi  CPOB
Peraturan Kepala Badan POM tentang sertifikasi CPOB
 
Peraturan Kepala Badan POM tentang obat wajib uji ekivalen
Peraturan Kepala Badan POM tentang obat wajib uji ekivalenPeraturan Kepala Badan POM tentang obat wajib uji ekivalen
Peraturan Kepala Badan POM tentang obat wajib uji ekivalen
 
Permenkes 1799 2010
Permenkes 1799 2010Permenkes 1799 2010
Permenkes 1799 2010
 

Similar to JAVA COMMUNICATIONS API

Similar to JAVA COMMUNICATIONS API (20)

Arduino LED maXbox starter18_3
Arduino LED maXbox starter18_3Arduino LED maXbox starter18_3
Arduino LED maXbox starter18_3
 
Code and Conquer with Globe Labs, October 27, 2012
Code and Conquer with Globe Labs, October 27, 2012Code and Conquer with Globe Labs, October 27, 2012
Code and Conquer with Globe Labs, October 27, 2012
 
Srgoc java
Srgoc javaSrgoc java
Srgoc java
 
Python Introduction
Python IntroductionPython Introduction
Python Introduction
 
delphi-interfaces.pdf
delphi-interfaces.pdfdelphi-interfaces.pdf
delphi-interfaces.pdf
 
delphi-interfaces.pdf
delphi-interfaces.pdfdelphi-interfaces.pdf
delphi-interfaces.pdf
 
delphi-interfaces.pdf
delphi-interfaces.pdfdelphi-interfaces.pdf
delphi-interfaces.pdf
 
Maxbox starter18
Maxbox starter18Maxbox starter18
Maxbox starter18
 
maXbox Arduino Tutorial
maXbox Arduino TutorialmaXbox Arduino Tutorial
maXbox Arduino Tutorial
 
180 daraga cpp course session-1
180 daraga cpp course session-1180 daraga cpp course session-1
180 daraga cpp course session-1
 
Scripting in OpenOffice.org
Scripting in OpenOffice.orgScripting in OpenOffice.org
Scripting in OpenOffice.org
 
Source-to-Source Compiler
Source-to-Source CompilerSource-to-Source Compiler
Source-to-Source Compiler
 
Advanced Java Topics
Advanced Java TopicsAdvanced Java Topics
Advanced Java Topics
 
Interfacing With High Level Programming Language
Interfacing With High Level Programming Language Interfacing With High Level Programming Language
Interfacing With High Level Programming Language
 
La 5 Pl Translator
La 5   Pl TranslatorLa 5   Pl Translator
La 5 Pl Translator
 
FINAL.ppt
FINAL.pptFINAL.ppt
FINAL.ppt
 
How a Compiler Works ?
How a Compiler Works ?How a Compiler Works ?
How a Compiler Works ?
 
Software programming and development
Software programming and developmentSoftware programming and development
Software programming and development
 
Phone gap development, testing, and debugging
Phone gap development, testing, and debuggingPhone gap development, testing, and debugging
Phone gap development, testing, and debugging
 
BIS07 Application Development - I
BIS07 Application Development - IBIS07 Application Development - I
BIS07 Application Development - I
 

Recently uploaded

Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 

Recently uploaded (20)

Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 

JAVA COMMUNICATIONS API

  • 1. PRESENTED BY EDWIN RAMIREZ TERRY MENA NILSA FUENTES
  • 2. This is a general purpose language, concurrent, class-based and object oriented language becomes completely independent of the platform and the both powerful. That philosophy and his ability to create applications for TCP / IP has made it one of the most used languages ​​today.
  • 3. RESOURCES To write Java programs needed to do the precompiled and interpretation of the code, are environments that allow the creation of the bytecodes and tools include ability to run applications of all kinds, the most famous Manual Java Developer Kit (JDK) from Sun, However, writing and compiling programs used and is a bit uncomfortable. So many companies make their own editing environments such as Netbeans, Eclipse. etc
  • 4. 1. Provide the Java Communications API control over any of the devices. Before using a device, the API must know. 2. Opening the device and put the line speed, parity, etc.. required. 3. Write or read some data using the protocol specified for the device. For example, if you have to communicate with a printer, you can send the codes start and end of work. 4. Close the port. USING COMMUNICATIONS API
  • 5. Enumeration listaPuertos = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier idPuerto = null; boolean encontrado = false; while (listaPuertos.hasMoreElements() && !encontrado) { idPuerto = (CommPortIdentifier) listaPuertos.nextElement(); if (idPuerto.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (idPuerto.getName().equals("COM1")) { encontrado = true; INITIALIZATION API WITH SERIAL
  • 6. Enumeration listaPuertos = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier idPuerto = null; boolean encontrado = false; while (listaPuertos.hasMoreElements() && !encontrado) { idPuerto = (CommPortIdentifier) listaPuertos.nextElement(); if (idPuerto.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (idPuerto.getName().equals("COM1")) { encontrado = true; INITIALIZATION API WITH SERIAL
  • 7. InputStream input = null; OutputStream out; SerialPort puertoSerie = null; public ControlPuertoSerie (String device, int baud, int timeout) throws Exception { CommPortIdentifier idPuerto = CommPortIdentifier.getPortIdentifier (device); puertoSerie = (SerialPort) idPuerto.openPort ("PuertoSerie", timeout); puertoSerie.setSerialPortParams(9600SerialPort.DATABITS_8,SerialPort.STOP BITS_1,SerialPort.PARITY_NONE); puertoSerie.setFlowcontrolMode(SerialPort.FLOWCTRL_NONE); puertoSerie.enableRcvThreshold(1); puertoSerie.enableRcvTimeout(timeout); System.out.println ("Open Serial Device"); puertoSerie.getOutputStream out = (); puertoSerie.getInputStream input = (); OPENING AND CONDITIONING DEVICES
  • 8. To write, you can do: try { salida.write (arraySalida, 0, length); And for reading data, you only have to do: try { int b = entrada.read () CLOSING PORTS try { entrada.close (); output.close (); } WRITING AND READING DATA